mirror of
https://github.com/haveno-dex/haveno.git
synced 2025-07-26 08:25:23 -04:00
Rename *Model => *DataModel
This commit is contained in:
parent
608f515b89
commit
b755b3fad3
24 changed files with 58 additions and 58 deletions
|
@ -42,7 +42,7 @@ import javafx.beans.property.StringProperty;
|
||||||
import javafx.collections.FXCollections;
|
import javafx.collections.FXCollections;
|
||||||
import javafx.collections.ObservableList;
|
import javafx.collections.ObservableList;
|
||||||
|
|
||||||
class FiatAccountModel implements Activatable, DataModel {
|
class FiatAccountDataModel implements Activatable, DataModel {
|
||||||
|
|
||||||
private final User user;
|
private final User user;
|
||||||
private final AccountSettings accountSettings;
|
private final AccountSettings accountSettings;
|
||||||
|
@ -68,7 +68,7 @@ class FiatAccountModel implements Activatable, DataModel {
|
||||||
|
|
||||||
|
|
||||||
@Inject
|
@Inject
|
||||||
public FiatAccountModel(User user, Persistence persistence, AccountSettings accountSettings) {
|
public FiatAccountDataModel(User user, Persistence persistence, AccountSettings accountSettings) {
|
||||||
this.persistence = persistence;
|
this.persistence = persistence;
|
||||||
this.user = user;
|
this.user = user;
|
||||||
this.accountSettings = accountSettings;
|
this.accountSettings = accountSettings;
|
|
@ -41,7 +41,7 @@ import javafx.collections.ListChangeListener;
|
||||||
import javafx.collections.ObservableList;
|
import javafx.collections.ObservableList;
|
||||||
import javafx.util.StringConverter;
|
import javafx.util.StringConverter;
|
||||||
|
|
||||||
class FiatAccountViewModel extends ActivatableWithDelegate<FiatAccountModel> implements ViewModel {
|
class FiatAccountViewModel extends ActivatableWithDelegate<FiatAccountDataModel> implements ViewModel {
|
||||||
|
|
||||||
private final BankAccountNumberValidator bankAccountNumberValidator;
|
private final BankAccountNumberValidator bankAccountNumberValidator;
|
||||||
|
|
||||||
|
@ -60,7 +60,7 @@ class FiatAccountViewModel extends ActivatableWithDelegate<FiatAccountModel> imp
|
||||||
|
|
||||||
|
|
||||||
@Inject
|
@Inject
|
||||||
public FiatAccountViewModel(FiatAccountModel model, BankAccountNumberValidator bankAccountNumberValidator) {
|
public FiatAccountViewModel(FiatAccountDataModel model, BankAccountNumberValidator bankAccountNumberValidator) {
|
||||||
super(model);
|
super(model);
|
||||||
this.bankAccountNumberValidator = bankAccountNumberValidator;
|
this.bankAccountNumberValidator = bankAccountNumberValidator;
|
||||||
|
|
||||||
|
|
|
@ -52,7 +52,7 @@ import javafx.beans.property.StringProperty;
|
||||||
import javafx.collections.FXCollections;
|
import javafx.collections.FXCollections;
|
||||||
import javafx.collections.ObservableList;
|
import javafx.collections.ObservableList;
|
||||||
|
|
||||||
class IrcAccountModel implements Activatable, DataModel {
|
class IrcAccountDataModel implements Activatable, DataModel {
|
||||||
|
|
||||||
private final User user;
|
private final User user;
|
||||||
private final AccountSettings accountSettings;
|
private final AccountSettings accountSettings;
|
||||||
|
@ -70,7 +70,7 @@ class IrcAccountModel implements Activatable, DataModel {
|
||||||
|
|
||||||
|
|
||||||
@Inject
|
@Inject
|
||||||
public IrcAccountModel(User user, Persistence persistence, AccountSettings accountSettings,
|
public IrcAccountDataModel(User user, Persistence persistence, AccountSettings accountSettings,
|
||||||
MessageService messageService) {
|
MessageService messageService) {
|
||||||
this.persistence = persistence;
|
this.persistence = persistence;
|
||||||
this.user = user;
|
this.user = user;
|
|
@ -38,7 +38,7 @@ import javafx.beans.property.StringProperty;
|
||||||
import javafx.collections.ObservableList;
|
import javafx.collections.ObservableList;
|
||||||
import javafx.util.StringConverter;
|
import javafx.util.StringConverter;
|
||||||
|
|
||||||
class IrcAccountViewModel extends ActivatableWithDelegate<IrcAccountModel> implements ViewModel {
|
class IrcAccountViewModel extends ActivatableWithDelegate<IrcAccountDataModel> implements ViewModel {
|
||||||
|
|
||||||
private final InputValidator nickNameValidator;
|
private final InputValidator nickNameValidator;
|
||||||
|
|
||||||
|
@ -49,7 +49,7 @@ class IrcAccountViewModel extends ActivatableWithDelegate<IrcAccountModel> imple
|
||||||
|
|
||||||
|
|
||||||
@Inject
|
@Inject
|
||||||
public IrcAccountViewModel(IrcAccountModel model, BankAccountNumberValidator nickNameValidator) {
|
public IrcAccountViewModel(IrcAccountDataModel model, BankAccountNumberValidator nickNameValidator) {
|
||||||
super(model);
|
super(model);
|
||||||
this.nickNameValidator = nickNameValidator;
|
this.nickNameValidator = nickNameValidator;
|
||||||
|
|
||||||
|
|
|
@ -45,8 +45,8 @@ import org.jetbrains.annotations.NotNull;
|
||||||
import org.slf4j.Logger;
|
import org.slf4j.Logger;
|
||||||
import org.slf4j.LoggerFactory;
|
import org.slf4j.LoggerFactory;
|
||||||
|
|
||||||
class RegistrationModel implements DataModel {
|
class RegistrationDataModel implements DataModel {
|
||||||
private static final Logger log = LoggerFactory.getLogger(RegistrationModel.class);
|
private static final Logger log = LoggerFactory.getLogger(RegistrationDataModel.class);
|
||||||
|
|
||||||
private final WalletService walletService;
|
private final WalletService walletService;
|
||||||
private final User user;
|
private final User user;
|
||||||
|
@ -61,7 +61,7 @@ class RegistrationModel implements DataModel {
|
||||||
|
|
||||||
|
|
||||||
@Inject
|
@Inject
|
||||||
public RegistrationModel(WalletService walletService, User user, Persistence persistence) {
|
public RegistrationDataModel(WalletService walletService, User user, Persistence persistence) {
|
||||||
|
|
||||||
this.walletService = walletService;
|
this.walletService = walletService;
|
||||||
this.user = user;
|
this.user = user;
|
|
@ -36,7 +36,7 @@ import javafx.beans.property.SimpleStringProperty;
|
||||||
import javafx.beans.property.StringProperty;
|
import javafx.beans.property.StringProperty;
|
||||||
|
|
||||||
|
|
||||||
class RegistrationViewModel extends WithDelegate<RegistrationModel> implements ViewModel {
|
class RegistrationViewModel extends WithDelegate<RegistrationDataModel> implements ViewModel {
|
||||||
|
|
||||||
final BooleanProperty isPayButtonDisabled = new SimpleBooleanProperty(true);
|
final BooleanProperty isPayButtonDisabled = new SimpleBooleanProperty(true);
|
||||||
final StringProperty requestPlaceOfferErrorMessage = new SimpleStringProperty();
|
final StringProperty requestPlaceOfferErrorMessage = new SimpleStringProperty();
|
||||||
|
@ -49,7 +49,7 @@ class RegistrationViewModel extends WithDelegate<RegistrationModel> implements V
|
||||||
|
|
||||||
|
|
||||||
@Inject
|
@Inject
|
||||||
public RegistrationViewModel(RegistrationModel delegate, BSFormatter formatter) {
|
public RegistrationViewModel(RegistrationDataModel delegate, BSFormatter formatter) {
|
||||||
super(delegate);
|
super(delegate);
|
||||||
this.formatter = formatter;
|
this.formatter = formatter;
|
||||||
|
|
||||||
|
|
|
@ -44,7 +44,7 @@ import java.util.Locale;
|
||||||
import javafx.collections.FXCollections;
|
import javafx.collections.FXCollections;
|
||||||
import javafx.collections.ObservableList;
|
import javafx.collections.ObservableList;
|
||||||
|
|
||||||
class RestrictionsModel implements Activatable, DataModel {
|
class RestrictionsDataModel implements Activatable, DataModel {
|
||||||
|
|
||||||
private final User user;
|
private final User user;
|
||||||
private final AccountSettings accountSettings;
|
private final AccountSettings accountSettings;
|
||||||
|
@ -60,7 +60,7 @@ class RestrictionsModel implements Activatable, DataModel {
|
||||||
|
|
||||||
|
|
||||||
@Inject
|
@Inject
|
||||||
public RestrictionsModel(User user, AccountSettings accountSettings, Persistence persistence,
|
public RestrictionsDataModel(User user, AccountSettings accountSettings, Persistence persistence,
|
||||||
MessageService messageService) {
|
MessageService messageService) {
|
||||||
this.user = user;
|
this.user = user;
|
||||||
this.accountSettings = accountSettings;
|
this.accountSettings = accountSettings;
|
|
@ -31,13 +31,13 @@ import javafx.beans.property.BooleanProperty;
|
||||||
import javafx.beans.property.SimpleBooleanProperty;
|
import javafx.beans.property.SimpleBooleanProperty;
|
||||||
import javafx.collections.ObservableList;
|
import javafx.collections.ObservableList;
|
||||||
|
|
||||||
class RestrictionsViewModel extends ActivatableWithDelegate<RestrictionsModel> implements ViewModel {
|
class RestrictionsViewModel extends ActivatableWithDelegate<RestrictionsDataModel> implements ViewModel {
|
||||||
|
|
||||||
final BooleanProperty doneButtonDisable = new SimpleBooleanProperty(true);
|
final BooleanProperty doneButtonDisable = new SimpleBooleanProperty(true);
|
||||||
|
|
||||||
|
|
||||||
@Inject
|
@Inject
|
||||||
public RestrictionsViewModel(RestrictionsModel model) {
|
public RestrictionsViewModel(RestrictionsDataModel model) {
|
||||||
super(model);
|
super(model);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -31,7 +31,7 @@ import javafx.collections.FXCollections;
|
||||||
import javafx.collections.MapChangeListener;
|
import javafx.collections.MapChangeListener;
|
||||||
import javafx.collections.ObservableList;
|
import javafx.collections.ObservableList;
|
||||||
|
|
||||||
class ClosedTradesModel implements Activatable, DataModel {
|
class ClosedTradesDataModel implements Activatable, DataModel {
|
||||||
|
|
||||||
private final TradeManager tradeManager;
|
private final TradeManager tradeManager;
|
||||||
private final User user;
|
private final User user;
|
||||||
|
@ -41,7 +41,7 @@ class ClosedTradesModel implements Activatable, DataModel {
|
||||||
|
|
||||||
|
|
||||||
@Inject
|
@Inject
|
||||||
public ClosedTradesModel(TradeManager tradeManager, User user) {
|
public ClosedTradesDataModel(TradeManager tradeManager, User user) {
|
||||||
this.tradeManager = tradeManager;
|
this.tradeManager = tradeManager;
|
||||||
this.user = user;
|
this.user = user;
|
||||||
|
|
|
@ -25,13 +25,13 @@ import com.google.inject.Inject;
|
||||||
|
|
||||||
import javafx.collections.ObservableList;
|
import javafx.collections.ObservableList;
|
||||||
|
|
||||||
class ClosedTradesViewModel extends ActivatableWithDelegate<ClosedTradesModel> implements ViewModel {
|
class ClosedTradesViewModel extends ActivatableWithDelegate<ClosedTradesDataModel> implements ViewModel {
|
||||||
|
|
||||||
private final BSFormatter formatter;
|
private final BSFormatter formatter;
|
||||||
|
|
||||||
|
|
||||||
@Inject
|
@Inject
|
||||||
public ClosedTradesViewModel(ClosedTradesModel model, BSFormatter formatter) {
|
public ClosedTradesViewModel(ClosedTradesDataModel model, BSFormatter formatter) {
|
||||||
super(model);
|
super(model);
|
||||||
|
|
||||||
this.formatter = formatter;
|
this.formatter = formatter;
|
||||||
|
|
|
@ -32,7 +32,7 @@ import javafx.collections.FXCollections;
|
||||||
import javafx.collections.MapChangeListener;
|
import javafx.collections.MapChangeListener;
|
||||||
import javafx.collections.ObservableList;
|
import javafx.collections.ObservableList;
|
||||||
|
|
||||||
class OffersModel implements Activatable, DataModel {
|
class OffersDataModel implements Activatable, DataModel {
|
||||||
|
|
||||||
private final TradeManager tradeManager;
|
private final TradeManager tradeManager;
|
||||||
private final User user;
|
private final User user;
|
||||||
|
@ -42,7 +42,7 @@ class OffersModel implements Activatable, DataModel {
|
||||||
|
|
||||||
|
|
||||||
@Inject
|
@Inject
|
||||||
public OffersModel(TradeManager tradeManager, User user) {
|
public OffersDataModel(TradeManager tradeManager, User user) {
|
||||||
this.tradeManager = tradeManager;
|
this.tradeManager = tradeManager;
|
||||||
this.user = user;
|
this.user = user;
|
||||||
|
|
|
@ -25,13 +25,13 @@ import com.google.inject.Inject;
|
||||||
|
|
||||||
import javafx.collections.ObservableList;
|
import javafx.collections.ObservableList;
|
||||||
|
|
||||||
class OffersViewModel extends ActivatableWithDelegate<OffersModel> implements ViewModel {
|
class OffersViewModel extends ActivatableWithDelegate<OffersDataModel> implements ViewModel {
|
||||||
|
|
||||||
private final BSFormatter formatter;
|
private final BSFormatter formatter;
|
||||||
|
|
||||||
|
|
||||||
@Inject
|
@Inject
|
||||||
public OffersViewModel(OffersModel model, BSFormatter formatter) {
|
public OffersViewModel(OffersDataModel model, BSFormatter formatter) {
|
||||||
super(model);
|
super(model);
|
||||||
|
|
||||||
this.formatter = formatter;
|
this.formatter = formatter;
|
||||||
|
|
|
@ -55,8 +55,8 @@ import org.jetbrains.annotations.NotNull;
|
||||||
import org.slf4j.Logger;
|
import org.slf4j.Logger;
|
||||||
import org.slf4j.LoggerFactory;
|
import org.slf4j.LoggerFactory;
|
||||||
|
|
||||||
class PendingTradesModel implements Activatable, DataModel {
|
class PendingTradesDataModel implements Activatable, DataModel {
|
||||||
private static final Logger log = LoggerFactory.getLogger(PendingTradesModel.class);
|
private static final Logger log = LoggerFactory.getLogger(PendingTradesDataModel.class);
|
||||||
|
|
||||||
private final TradeManager tradeManager;
|
private final TradeManager tradeManager;
|
||||||
private final WalletService walletService;
|
private final WalletService walletService;
|
||||||
|
@ -79,7 +79,7 @@ class PendingTradesModel implements Activatable, DataModel {
|
||||||
|
|
||||||
|
|
||||||
@Inject
|
@Inject
|
||||||
public PendingTradesModel(TradeManager tradeManager, WalletService walletService, User user) {
|
public PendingTradesDataModel(TradeManager tradeManager, WalletService walletService, User user) {
|
||||||
this.tradeManager = tradeManager;
|
this.tradeManager = tradeManager;
|
||||||
this.walletService = walletService;
|
this.walletService = walletService;
|
||||||
this.user = user;
|
this.user = user;
|
|
@ -44,7 +44,7 @@ import javafx.collections.ObservableList;
|
||||||
import org.slf4j.Logger;
|
import org.slf4j.Logger;
|
||||||
import org.slf4j.LoggerFactory;
|
import org.slf4j.LoggerFactory;
|
||||||
|
|
||||||
class PendingTradesViewModel extends ActivatableWithDelegate<PendingTradesModel> implements ViewModel {
|
class PendingTradesViewModel extends ActivatableWithDelegate<PendingTradesDataModel> implements ViewModel {
|
||||||
private static final Logger log = LoggerFactory.getLogger(PendingTradesViewModel.class);
|
private static final Logger log = LoggerFactory.getLogger(PendingTradesViewModel.class);
|
||||||
|
|
||||||
enum State {
|
enum State {
|
||||||
|
@ -70,7 +70,7 @@ class PendingTradesViewModel extends ActivatableWithDelegate<PendingTradesModel>
|
||||||
|
|
||||||
|
|
||||||
@Inject
|
@Inject
|
||||||
public PendingTradesViewModel(PendingTradesModel delegate, BSFormatter formatter,
|
public PendingTradesViewModel(PendingTradesDataModel delegate, BSFormatter formatter,
|
||||||
BtcAddressValidator btcAddressValidator) {
|
BtcAddressValidator btcAddressValidator) {
|
||||||
super(delegate);
|
super(delegate);
|
||||||
|
|
||||||
|
|
|
@ -31,7 +31,7 @@ import javafx.beans.value.ChangeListener;
|
||||||
import javafx.collections.FXCollections;
|
import javafx.collections.FXCollections;
|
||||||
import javafx.collections.ObservableList;
|
import javafx.collections.ObservableList;
|
||||||
|
|
||||||
class PreferencesModel implements Activatable, DataModel {
|
class PreferencesDataModel implements Activatable, DataModel {
|
||||||
|
|
||||||
private final Preferences preferences;
|
private final Preferences preferences;
|
||||||
|
|
||||||
|
@ -47,7 +47,7 @@ class PreferencesModel implements Activatable, DataModel {
|
||||||
|
|
||||||
|
|
||||||
@Inject
|
@Inject
|
||||||
public PreferencesModel(Preferences preferences) {
|
public PreferencesDataModel(Preferences preferences) {
|
||||||
this.preferences = preferences;
|
this.preferences = preferences;
|
||||||
|
|
||||||
btcDenominations = FXCollections.observableArrayList(preferences.getBtcDenominations());
|
btcDenominations = FXCollections.observableArrayList(preferences.getBtcDenominations());
|
|
@ -26,10 +26,10 @@ import javafx.beans.property.BooleanProperty;
|
||||||
import javafx.beans.property.StringProperty;
|
import javafx.beans.property.StringProperty;
|
||||||
import javafx.collections.ObservableList;
|
import javafx.collections.ObservableList;
|
||||||
|
|
||||||
class PreferencesViewModel extends ActivatableWithDelegate<PreferencesModel> implements ViewModel {
|
class PreferencesViewModel extends ActivatableWithDelegate<PreferencesDataModel> implements ViewModel {
|
||||||
|
|
||||||
@Inject
|
@Inject
|
||||||
public PreferencesViewModel(PreferencesModel model) {
|
public PreferencesViewModel(PreferencesDataModel model) {
|
||||||
super(model);
|
super(model);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -65,8 +65,8 @@ import static com.google.common.base.Preconditions.checkArgument;
|
||||||
* Note that the create offer domain has a deeper scope in the application domain (TradeManager).
|
* Note that the create offer domain has a deeper scope in the application domain (TradeManager).
|
||||||
* That model is just responsible for the domain specific parts displayed needed in that UI element.
|
* That model is just responsible for the domain specific parts displayed needed in that UI element.
|
||||||
*/
|
*/
|
||||||
class CreateOfferModel implements Activatable, DataModel {
|
class CreateOfferDataModel implements Activatable, DataModel {
|
||||||
private static final Logger log = LoggerFactory.getLogger(CreateOfferModel.class);
|
private static final Logger log = LoggerFactory.getLogger(CreateOfferDataModel.class);
|
||||||
|
|
||||||
private final TradeManager tradeManager;
|
private final TradeManager tradeManager;
|
||||||
private final WalletService walletService;
|
private final WalletService walletService;
|
||||||
|
@ -109,7 +109,7 @@ class CreateOfferModel implements Activatable, DataModel {
|
||||||
|
|
||||||
// non private for testing
|
// non private for testing
|
||||||
@Inject
|
@Inject
|
||||||
public CreateOfferModel(TradeManager tradeManager, WalletService walletService, AccountSettings accountSettings,
|
public CreateOfferDataModel(TradeManager tradeManager, WalletService walletService, AccountSettings accountSettings,
|
||||||
Preferences preferences, User user, Persistence persistence,
|
Preferences preferences, User user, Persistence persistence,
|
||||||
BSFormatter formatter) {
|
BSFormatter formatter) {
|
||||||
this.tradeManager = tradeManager;
|
this.tradeManager = tradeManager;
|
|
@ -44,7 +44,7 @@ import javafx.beans.property.StringProperty;
|
||||||
|
|
||||||
import static javafx.beans.binding.Bindings.createStringBinding;
|
import static javafx.beans.binding.Bindings.createStringBinding;
|
||||||
|
|
||||||
class CreateOfferViewModel extends ActivatableWithDelegate<CreateOfferModel> implements ViewModel {
|
class CreateOfferViewModel extends ActivatableWithDelegate<CreateOfferDataModel> implements ViewModel {
|
||||||
|
|
||||||
private final BtcValidator btcValidator;
|
private final BtcValidator btcValidator;
|
||||||
private final BSFormatter formatter;
|
private final BSFormatter formatter;
|
||||||
|
@ -93,7 +93,7 @@ class CreateOfferViewModel extends ActivatableWithDelegate<CreateOfferModel> imp
|
||||||
|
|
||||||
|
|
||||||
@Inject
|
@Inject
|
||||||
public CreateOfferViewModel(CreateOfferModel model, FiatValidator fiatValidator, BtcValidator btcValidator,
|
public CreateOfferViewModel(CreateOfferDataModel model, FiatValidator fiatValidator, BtcValidator btcValidator,
|
||||||
BSFormatter formatter) {
|
BSFormatter formatter) {
|
||||||
super(model);
|
super(model);
|
||||||
|
|
||||||
|
|
|
@ -41,7 +41,7 @@ import static com.google.common.base.Preconditions.checkArgument;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Holds and manages the unsorted and unfiltered offerbook list of both buy and sell offers.
|
* Holds and manages the unsorted and unfiltered offerbook list of both buy and sell offers.
|
||||||
* It is handled as singleton by Guice and is used by 2 instances of OfferBookModel (one for Buy one for Sell).
|
* It is handled as singleton by Guice and is used by 2 instances of OfferBookDataModel (one for Buy one for Sell).
|
||||||
* As it is used only by the Buy and Sell UIs we treat it as local UI model.
|
* As it is used only by the Buy and Sell UIs we treat it as local UI model.
|
||||||
* It also use OfferRepository.Listener as the lists items class and we don't want to get any dependency out of the
|
* It also use OfferRepository.Listener as the lists items class and we don't want to get any dependency out of the
|
||||||
* package for that.
|
* package for that.
|
||||||
|
|
|
@ -52,8 +52,8 @@ import org.slf4j.LoggerFactory;
|
||||||
/**
|
/**
|
||||||
* It holds the scope specific domain data for either a buy or sell UI screen.
|
* It holds the scope specific domain data for either a buy or sell UI screen.
|
||||||
*/
|
*/
|
||||||
class OfferBookModel implements Activatable, DataModel {
|
class OfferBookDataModel implements Activatable, DataModel {
|
||||||
private static final Logger log = LoggerFactory.getLogger(OfferBookModel.class);
|
private static final Logger log = LoggerFactory.getLogger(OfferBookDataModel.class);
|
||||||
|
|
||||||
private final User user;
|
private final User user;
|
||||||
private final OfferBook offerBook;
|
private final OfferBook offerBook;
|
||||||
|
@ -79,7 +79,7 @@ class OfferBookModel implements Activatable, DataModel {
|
||||||
|
|
||||||
|
|
||||||
@Inject
|
@Inject
|
||||||
public OfferBookModel(User user, TradeManager tradeManager, OfferBook offerBook, Preferences preferences,
|
public OfferBookDataModel(User user, TradeManager tradeManager, OfferBook offerBook, Preferences preferences,
|
||||||
BSFormatter formatter) {
|
BSFormatter formatter) {
|
||||||
this.tradeManager = tradeManager;
|
this.tradeManager = tradeManager;
|
||||||
this.user = user;
|
this.user = user;
|
|
@ -36,7 +36,7 @@ import javafx.beans.property.SimpleStringProperty;
|
||||||
import javafx.beans.property.StringProperty;
|
import javafx.beans.property.StringProperty;
|
||||||
import javafx.collections.transformation.SortedList;
|
import javafx.collections.transformation.SortedList;
|
||||||
|
|
||||||
class OfferBookViewModel extends ActivatableWithDelegate<OfferBookModel> implements ViewModel {
|
class OfferBookViewModel extends ActivatableWithDelegate<OfferBookDataModel> implements ViewModel {
|
||||||
|
|
||||||
private final OptionalBtcValidator optionalBtcValidator;
|
private final OptionalBtcValidator optionalBtcValidator;
|
||||||
private final BSFormatter formatter;
|
private final BSFormatter formatter;
|
||||||
|
@ -51,7 +51,7 @@ class OfferBookViewModel extends ActivatableWithDelegate<OfferBookModel> impleme
|
||||||
|
|
||||||
|
|
||||||
@Inject
|
@Inject
|
||||||
public OfferBookViewModel(OfferBookModel delegate, OptionalFiatValidator optionalFiatValidator,
|
public OfferBookViewModel(OfferBookDataModel delegate, OptionalFiatValidator optionalFiatValidator,
|
||||||
OptionalBtcValidator optionalBtcValidator, BSFormatter formatter) {
|
OptionalBtcValidator optionalBtcValidator, BSFormatter formatter) {
|
||||||
super(delegate);
|
super(delegate);
|
||||||
|
|
||||||
|
|
|
@ -52,8 +52,8 @@ import org.slf4j.LoggerFactory;
|
||||||
* Note that the create offer domain has a deeper scope in the application domain (TradeManager).
|
* Note that the create offer domain has a deeper scope in the application domain (TradeManager).
|
||||||
* That model is just responsible for the domain specific parts displayed needed in that UI element.
|
* That model is just responsible for the domain specific parts displayed needed in that UI element.
|
||||||
*/
|
*/
|
||||||
class TakeOfferModel implements Activatable, DataModel {
|
class TakeOfferDataModel implements Activatable, DataModel {
|
||||||
private static final Logger log = LoggerFactory.getLogger(TakeOfferModel.class);
|
private static final Logger log = LoggerFactory.getLogger(TakeOfferDataModel.class);
|
||||||
|
|
||||||
private final TradeManager tradeManager;
|
private final TradeManager tradeManager;
|
||||||
private final WalletService walletService;
|
private final WalletService walletService;
|
||||||
|
@ -80,7 +80,7 @@ class TakeOfferModel implements Activatable, DataModel {
|
||||||
|
|
||||||
|
|
||||||
@Inject
|
@Inject
|
||||||
public TakeOfferModel(TradeManager tradeManager, WalletService walletService, Preferences preferences,
|
public TakeOfferDataModel(TradeManager tradeManager, WalletService walletService, Preferences preferences,
|
||||||
Persistence persistence) {
|
Persistence persistence) {
|
||||||
this.tradeManager = tradeManager;
|
this.tradeManager = tradeManager;
|
||||||
this.walletService = walletService;
|
this.walletService = walletService;
|
|
@ -41,7 +41,7 @@ import javafx.beans.property.StringProperty;
|
||||||
|
|
||||||
import static javafx.beans.binding.Bindings.createStringBinding;
|
import static javafx.beans.binding.Bindings.createStringBinding;
|
||||||
|
|
||||||
class TakeOfferViewModel extends ActivatableWithDelegate<TakeOfferModel> implements ViewModel {
|
class TakeOfferViewModel extends ActivatableWithDelegate<TakeOfferDataModel> implements ViewModel {
|
||||||
|
|
||||||
private String fiatCode;
|
private String fiatCode;
|
||||||
private String amountRange;
|
private String amountRange;
|
||||||
|
@ -87,7 +87,7 @@ class TakeOfferViewModel extends ActivatableWithDelegate<TakeOfferModel> impleme
|
||||||
|
|
||||||
|
|
||||||
@Inject
|
@Inject
|
||||||
public TakeOfferViewModel(TakeOfferModel model, BtcValidator btcValidator, BSFormatter formatter) {
|
public TakeOfferViewModel(TakeOfferDataModel model, BtcValidator btcValidator, BSFormatter formatter) {
|
||||||
super(model);
|
super(model);
|
||||||
|
|
||||||
this.btcValidator = btcValidator;
|
this.btcValidator = btcValidator;
|
||||||
|
|
|
@ -40,7 +40,7 @@ import static org.junit.Assert.*;
|
||||||
public class CreateOfferViewModelTest {
|
public class CreateOfferViewModelTest {
|
||||||
private static final Logger log = LoggerFactory.getLogger(CreateOfferViewModelTest.class);
|
private static final Logger log = LoggerFactory.getLogger(CreateOfferViewModelTest.class);
|
||||||
|
|
||||||
private CreateOfferModel model;
|
private CreateOfferDataModel model;
|
||||||
private CreateOfferViewModel presenter;
|
private CreateOfferViewModel presenter;
|
||||||
|
|
||||||
@Before
|
@Before
|
||||||
|
@ -48,7 +48,7 @@ public class CreateOfferViewModelTest {
|
||||||
BSFormatter formatter = new BSFormatter(new User());
|
BSFormatter formatter = new BSFormatter(new User());
|
||||||
formatter.setLocale(Locale.US);
|
formatter.setLocale(Locale.US);
|
||||||
formatter.setFiatCurrencyCode("USD");
|
formatter.setFiatCurrencyCode("USD");
|
||||||
model = new CreateOfferModel(null, null, null, null, null, null, formatter);
|
model = new CreateOfferDataModel(null, null, null, null, null, null, formatter);
|
||||||
|
|
||||||
presenter = new CreateOfferViewModel(model, new FiatValidator(null), new BtcValidator(), formatter);
|
presenter = new CreateOfferViewModel(model, new FiatValidator(null), new BtcValidator(), formatter);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue