mirror of
https://github.com/haveno-dex/haveno.git
synced 2025-05-25 18:00:58 -04:00
Rename *PM => *ViewModel
This commit is contained in:
parent
a7fe05de00
commit
608f515b89
32 changed files with 73 additions and 73 deletions
|
@ -29,7 +29,7 @@ import org.slf4j.Logger;
|
||||||
import org.slf4j.LoggerFactory;
|
import org.slf4j.LoggerFactory;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Non caching version for code behind classes using the PM pattern
|
* Non caching version for code behind classes using the ViewModel pattern
|
||||||
*/
|
*/
|
||||||
public abstract class View<M> implements Initializable {
|
public abstract class View<M> implements Initializable {
|
||||||
|
|
||||||
|
|
|
@ -45,7 +45,7 @@ public class AccountView extends ActivatableView {
|
||||||
|
|
||||||
@FXML Tab accountSettingsTab, arbitratorSettingsTab;
|
@FXML Tab accountSettingsTab, arbitratorSettingsTab;
|
||||||
|
|
||||||
private final AccountPM model;
|
private final AccountViewModel model;
|
||||||
private final ViewLoader viewLoader;
|
private final ViewLoader viewLoader;
|
||||||
private final Navigation navigation;
|
private final Navigation navigation;
|
||||||
|
|
||||||
|
@ -55,7 +55,7 @@ public class AccountView extends ActivatableView {
|
||||||
///////////////////////////////////////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
@Inject
|
@Inject
|
||||||
private AccountView(AccountPM model, ViewLoader viewLoader, Navigation navigation) {
|
private AccountView(AccountViewModel model, ViewLoader viewLoader, Navigation navigation) {
|
||||||
this.model = model;
|
this.model = model;
|
||||||
this.viewLoader = viewLoader;
|
this.viewLoader = viewLoader;
|
||||||
this.navigation = navigation;
|
this.navigation = navigation;
|
||||||
|
|
|
@ -22,12 +22,12 @@ import io.bitsquare.user.User;
|
||||||
|
|
||||||
import com.google.inject.Inject;
|
import com.google.inject.Inject;
|
||||||
|
|
||||||
class AccountPM implements ViewModel {
|
class AccountViewModel implements ViewModel {
|
||||||
|
|
||||||
private final User user;
|
private final User user;
|
||||||
|
|
||||||
@Inject
|
@Inject
|
||||||
public AccountPM(User user) {
|
public AccountViewModel(User user) {
|
||||||
this.user = user;
|
this.user = user;
|
||||||
}
|
}
|
||||||
|
|
|
@ -36,7 +36,7 @@ import javafx.scene.layout.*;
|
||||||
import org.slf4j.Logger;
|
import org.slf4j.Logger;
|
||||||
import org.slf4j.LoggerFactory;
|
import org.slf4j.LoggerFactory;
|
||||||
|
|
||||||
public class ChangePasswordView extends View<ChangePasswordPM> implements ContextAware {
|
public class ChangePasswordView extends View<ChangePasswordViewModel> implements ContextAware {
|
||||||
|
|
||||||
private static final Logger log = LoggerFactory.getLogger(ChangePasswordView.class);
|
private static final Logger log = LoggerFactory.getLogger(ChangePasswordView.class);
|
||||||
|
|
||||||
|
@ -50,7 +50,7 @@ public class ChangePasswordView extends View<ChangePasswordPM> implements Contex
|
||||||
///////////////////////////////////////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
@Inject
|
@Inject
|
||||||
private ChangePasswordView(ChangePasswordPM model) {
|
private ChangePasswordView(ChangePasswordViewModel model) {
|
||||||
super(model);
|
super(model);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -28,7 +28,7 @@ import javafx.beans.property.SimpleBooleanProperty;
|
||||||
import javafx.beans.property.SimpleStringProperty;
|
import javafx.beans.property.SimpleStringProperty;
|
||||||
import javafx.beans.property.StringProperty;
|
import javafx.beans.property.StringProperty;
|
||||||
|
|
||||||
class ChangePasswordPM implements ViewModel {
|
class ChangePasswordViewModel implements ViewModel {
|
||||||
|
|
||||||
private final PasswordValidator passwordValidator;
|
private final PasswordValidator passwordValidator;
|
||||||
|
|
||||||
|
@ -40,7 +40,7 @@ class ChangePasswordPM implements ViewModel {
|
||||||
|
|
||||||
|
|
||||||
@Inject
|
@Inject
|
||||||
public ChangePasswordPM(PasswordValidator passwordValidator) {
|
public ChangePasswordViewModel(PasswordValidator passwordValidator) {
|
||||||
this.passwordValidator = passwordValidator;
|
this.passwordValidator = passwordValidator;
|
||||||
|
|
||||||
passwordField.addListener((ov) -> saveButtonDisabled.set(!validate()));
|
passwordField.addListener((ov) -> saveButtonDisabled.set(!validate()));
|
|
@ -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 FiatAccountPM extends ActivatableWithDelegate<FiatAccountModel> implements ViewModel {
|
class FiatAccountViewModel extends ActivatableWithDelegate<FiatAccountModel> implements ViewModel {
|
||||||
|
|
||||||
private final BankAccountNumberValidator bankAccountNumberValidator;
|
private final BankAccountNumberValidator bankAccountNumberValidator;
|
||||||
|
|
||||||
|
@ -60,7 +60,7 @@ class FiatAccountPM extends ActivatableWithDelegate<FiatAccountModel> implements
|
||||||
|
|
||||||
|
|
||||||
@Inject
|
@Inject
|
||||||
public FiatAccountPM(FiatAccountModel model, BankAccountNumberValidator bankAccountNumberValidator) {
|
public FiatAccountViewModel(FiatAccountModel model, BankAccountNumberValidator bankAccountNumberValidator) {
|
||||||
super(model);
|
super(model);
|
||||||
this.bankAccountNumberValidator = bankAccountNumberValidator;
|
this.bankAccountNumberValidator = bankAccountNumberValidator;
|
||||||
|
|
||||||
|
|
|
@ -56,7 +56,7 @@ import org.slf4j.LoggerFactory;
|
||||||
|
|
||||||
import static javafx.beans.binding.Bindings.createBooleanBinding;
|
import static javafx.beans.binding.Bindings.createBooleanBinding;
|
||||||
|
|
||||||
public class FiatAccountView extends ActivatableView<FiatAccountPM> implements ContextAware {
|
public class FiatAccountView extends ActivatableView<FiatAccountViewModel> implements ContextAware {
|
||||||
|
|
||||||
private static final Logger log = LoggerFactory.getLogger(FiatAccountView.class);
|
private static final Logger log = LoggerFactory.getLogger(FiatAccountView.class);
|
||||||
|
|
||||||
|
@ -76,7 +76,7 @@ public class FiatAccountView extends ActivatableView<FiatAccountPM> implements C
|
||||||
///////////////////////////////////////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
@Inject
|
@Inject
|
||||||
FiatAccountView(FiatAccountPM model, OverlayManager overlayManager) {
|
FiatAccountView(FiatAccountViewModel model, OverlayManager overlayManager) {
|
||||||
super(model);
|
super(model);
|
||||||
|
|
||||||
this.overlayManager = overlayManager;
|
this.overlayManager = overlayManager;
|
||||||
|
|
|
@ -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 IrcAccountPM extends ActivatableWithDelegate<IrcAccountModel> implements ViewModel {
|
class IrcAccountViewModel extends ActivatableWithDelegate<IrcAccountModel> implements ViewModel {
|
||||||
|
|
||||||
private final InputValidator nickNameValidator;
|
private final InputValidator nickNameValidator;
|
||||||
|
|
||||||
|
@ -49,7 +49,7 @@ class IrcAccountPM extends ActivatableWithDelegate<IrcAccountModel> implements V
|
||||||
|
|
||||||
|
|
||||||
@Inject
|
@Inject
|
||||||
public IrcAccountPM(IrcAccountModel model, BankAccountNumberValidator nickNameValidator) {
|
public IrcAccountViewModel(IrcAccountModel model, BankAccountNumberValidator nickNameValidator) {
|
||||||
super(model);
|
super(model);
|
||||||
this.nickNameValidator = nickNameValidator;
|
this.nickNameValidator = nickNameValidator;
|
||||||
|
|
||||||
|
|
|
@ -47,7 +47,7 @@ import org.slf4j.LoggerFactory;
|
||||||
/*
|
/*
|
||||||
Just temporary for giving the user a possibility to test the app via simulating the bank transfer in a IRC chat.
|
Just temporary for giving the user a possibility to test the app via simulating the bank transfer in a IRC chat.
|
||||||
*/
|
*/
|
||||||
public class IrcAccountView extends ActivatableView<IrcAccountPM> implements ContextAware {
|
public class IrcAccountView extends ActivatableView<IrcAccountViewModel> implements ContextAware {
|
||||||
|
|
||||||
private static final Logger log = LoggerFactory.getLogger(IrcAccountView.class);
|
private static final Logger log = LoggerFactory.getLogger(IrcAccountView.class);
|
||||||
|
|
||||||
|
@ -63,7 +63,7 @@ public class IrcAccountView extends ActivatableView<IrcAccountPM> implements Con
|
||||||
///////////////////////////////////////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
@Inject
|
@Inject
|
||||||
IrcAccountView(IrcAccountPM model) {
|
IrcAccountView(IrcAccountViewModel model) {
|
||||||
super(model);
|
super(model);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -36,7 +36,7 @@ import javafx.scene.layout.*;
|
||||||
import org.slf4j.Logger;
|
import org.slf4j.Logger;
|
||||||
import org.slf4j.LoggerFactory;
|
import org.slf4j.LoggerFactory;
|
||||||
|
|
||||||
public class PasswordView extends View<PasswordPM> implements ContextAware {
|
public class PasswordView extends View<PasswordViewModel> implements ContextAware {
|
||||||
|
|
||||||
private static final Logger log = LoggerFactory.getLogger(PasswordView.class);
|
private static final Logger log = LoggerFactory.getLogger(PasswordView.class);
|
||||||
|
|
||||||
|
@ -50,7 +50,7 @@ public class PasswordView extends View<PasswordPM> implements ContextAware {
|
||||||
///////////////////////////////////////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
@Inject
|
@Inject
|
||||||
private PasswordView(PasswordPM model) {
|
private PasswordView(PasswordViewModel model) {
|
||||||
super(model);
|
super(model);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -28,7 +28,7 @@ import javafx.beans.property.SimpleBooleanProperty;
|
||||||
import javafx.beans.property.SimpleStringProperty;
|
import javafx.beans.property.SimpleStringProperty;
|
||||||
import javafx.beans.property.StringProperty;
|
import javafx.beans.property.StringProperty;
|
||||||
|
|
||||||
class PasswordPM implements ViewModel {
|
class PasswordViewModel implements ViewModel {
|
||||||
|
|
||||||
private final PasswordValidator passwordValidator;
|
private final PasswordValidator passwordValidator;
|
||||||
|
|
||||||
|
@ -40,7 +40,7 @@ class PasswordPM implements ViewModel {
|
||||||
|
|
||||||
|
|
||||||
@Inject
|
@Inject
|
||||||
public PasswordPM(PasswordValidator passwordValidator) {
|
public PasswordViewModel(PasswordValidator passwordValidator) {
|
||||||
this.passwordValidator = passwordValidator;
|
this.passwordValidator = passwordValidator;
|
||||||
|
|
||||||
passwordField.addListener((ov) -> saveButtonDisabled.set(!validate()));
|
passwordField.addListener((ov) -> saveButtonDisabled.set(!validate()));
|
|
@ -48,7 +48,7 @@ import org.slf4j.Logger;
|
||||||
import org.slf4j.LoggerFactory;
|
import org.slf4j.LoggerFactory;
|
||||||
|
|
||||||
|
|
||||||
public class RegistrationView extends View<RegistrationPM> implements ContextAware {
|
public class RegistrationView extends View<RegistrationViewModel> implements ContextAware {
|
||||||
|
|
||||||
private static final Logger log = LoggerFactory.getLogger(RegistrationView.class);
|
private static final Logger log = LoggerFactory.getLogger(RegistrationView.class);
|
||||||
|
|
||||||
|
@ -67,7 +67,7 @@ public class RegistrationView extends View<RegistrationPM> implements ContextAwa
|
||||||
///////////////////////////////////////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
@Inject
|
@Inject
|
||||||
private RegistrationView(RegistrationPM model, OverlayManager overlayManager) {
|
private RegistrationView(RegistrationViewModel model, OverlayManager overlayManager) {
|
||||||
super(model);
|
super(model);
|
||||||
this.overlayManager = overlayManager;
|
this.overlayManager = overlayManager;
|
||||||
}
|
}
|
||||||
|
|
|
@ -36,7 +36,7 @@ import javafx.beans.property.SimpleStringProperty;
|
||||||
import javafx.beans.property.StringProperty;
|
import javafx.beans.property.StringProperty;
|
||||||
|
|
||||||
|
|
||||||
class RegistrationPM extends WithDelegate<RegistrationModel> implements ViewModel {
|
class RegistrationViewModel extends WithDelegate<RegistrationModel> 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 RegistrationPM extends WithDelegate<RegistrationModel> implements ViewMode
|
||||||
|
|
||||||
|
|
||||||
@Inject
|
@Inject
|
||||||
public RegistrationPM(RegistrationModel delegate, BSFormatter formatter) {
|
public RegistrationViewModel(RegistrationModel delegate, BSFormatter formatter) {
|
||||||
super(delegate);
|
super(delegate);
|
||||||
this.formatter = formatter;
|
this.formatter = formatter;
|
||||||
|
|
|
@ -50,7 +50,7 @@ import javafx.util.StringConverter;
|
||||||
import org.slf4j.Logger;
|
import org.slf4j.Logger;
|
||||||
import org.slf4j.LoggerFactory;
|
import org.slf4j.LoggerFactory;
|
||||||
|
|
||||||
public class RestrictionsView extends ActivatableView<RestrictionsPM> implements ContextAware {
|
public class RestrictionsView extends ActivatableView<RestrictionsViewModel> implements ContextAware {
|
||||||
|
|
||||||
private static final Logger log = LoggerFactory.getLogger(RestrictionsView.class);
|
private static final Logger log = LoggerFactory.getLogger(RestrictionsView.class);
|
||||||
|
|
||||||
|
@ -71,7 +71,7 @@ public class RestrictionsView extends ActivatableView<RestrictionsPM> implements
|
||||||
///////////////////////////////////////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
@Inject
|
@Inject
|
||||||
private RestrictionsView(RestrictionsPM model, ViewLoader viewLoader, Stage primaryStage) {
|
private RestrictionsView(RestrictionsViewModel model, ViewLoader viewLoader, Stage primaryStage) {
|
||||||
super(model);
|
super(model);
|
||||||
this.viewLoader = viewLoader;
|
this.viewLoader = viewLoader;
|
||||||
this.primaryStage = primaryStage;
|
this.primaryStage = primaryStage;
|
||||||
|
|
|
@ -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 RestrictionsPM extends ActivatableWithDelegate<RestrictionsModel> implements ViewModel {
|
class RestrictionsViewModel extends ActivatableWithDelegate<RestrictionsModel> implements ViewModel {
|
||||||
|
|
||||||
final BooleanProperty doneButtonDisable = new SimpleBooleanProperty(true);
|
final BooleanProperty doneButtonDisable = new SimpleBooleanProperty(true);
|
||||||
|
|
||||||
|
|
||||||
@Inject
|
@Inject
|
||||||
public RestrictionsPM(RestrictionsModel model) {
|
public RestrictionsViewModel(RestrictionsModel model) {
|
||||||
super(model);
|
super(model);
|
||||||
}
|
}
|
||||||
|
|
|
@ -36,7 +36,7 @@ import javafx.scene.layout.*;
|
||||||
import org.slf4j.Logger;
|
import org.slf4j.Logger;
|
||||||
import org.slf4j.LoggerFactory;
|
import org.slf4j.LoggerFactory;
|
||||||
|
|
||||||
public class SeedWordsView extends View<SeedWordsPM> implements ContextAware {
|
public class SeedWordsView extends View<SeedWordsViewModel> implements ContextAware {
|
||||||
|
|
||||||
private static final Logger log = LoggerFactory.getLogger(SeedWordsView.class);
|
private static final Logger log = LoggerFactory.getLogger(SeedWordsView.class);
|
||||||
|
|
||||||
|
@ -49,7 +49,7 @@ public class SeedWordsView extends View<SeedWordsPM> implements ContextAware {
|
||||||
///////////////////////////////////////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
@Inject
|
@Inject
|
||||||
private SeedWordsView(SeedWordsPM model) {
|
private SeedWordsView(SeedWordsViewModel model) {
|
||||||
super(model);
|
super(model);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -28,12 +28,12 @@ import java.util.List;
|
||||||
import javafx.beans.property.SimpleStringProperty;
|
import javafx.beans.property.SimpleStringProperty;
|
||||||
import javafx.beans.property.StringProperty;
|
import javafx.beans.property.StringProperty;
|
||||||
|
|
||||||
class SeedWordsPM implements ViewModel {
|
class SeedWordsViewModel implements ViewModel {
|
||||||
|
|
||||||
final StringProperty seedWords = new SimpleStringProperty();
|
final StringProperty seedWords = new SimpleStringProperty();
|
||||||
|
|
||||||
@Inject
|
@Inject
|
||||||
public SeedWordsPM(WalletService walletService, BSFormatter formatter) {
|
public SeedWordsViewModel(WalletService walletService, BSFormatter formatter) {
|
||||||
if (walletService.getWallet() != null) {
|
if (walletService.getWallet() != null) {
|
||||||
List<String> mnemonicCode = walletService.getWallet().getKeyChainSeed().getMnemonicCode();
|
List<String> mnemonicCode = walletService.getWallet().getKeyChainSeed().getMnemonicCode();
|
||||||
if (mnemonicCode != null) {
|
if (mnemonicCode != null) {
|
|
@ -34,7 +34,7 @@ import javafx.util.Callback;
|
||||||
import org.slf4j.Logger;
|
import org.slf4j.Logger;
|
||||||
import org.slf4j.LoggerFactory;
|
import org.slf4j.LoggerFactory;
|
||||||
|
|
||||||
public class ClosedTradesView extends ActivatableView<ClosedTradesPM> {
|
public class ClosedTradesView extends ActivatableView<ClosedTradesViewModel> {
|
||||||
private static final Logger log = LoggerFactory.getLogger(ClosedTradesView.class);
|
private static final Logger log = LoggerFactory.getLogger(ClosedTradesView.class);
|
||||||
|
|
||||||
@FXML TableColumn<ClosedTradesListItem, ClosedTradesListItem> priceColumn, amountColumn, volumeColumn,
|
@FXML TableColumn<ClosedTradesListItem, ClosedTradesListItem> priceColumn, amountColumn, volumeColumn,
|
||||||
|
@ -47,7 +47,7 @@ public class ClosedTradesView extends ActivatableView<ClosedTradesPM> {
|
||||||
///////////////////////////////////////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
@Inject
|
@Inject
|
||||||
private ClosedTradesView(ClosedTradesPM model) {
|
private ClosedTradesView(ClosedTradesViewModel model) {
|
||||||
super(model);
|
super(model);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -25,13 +25,13 @@ import com.google.inject.Inject;
|
||||||
|
|
||||||
import javafx.collections.ObservableList;
|
import javafx.collections.ObservableList;
|
||||||
|
|
||||||
class ClosedTradesPM extends ActivatableWithDelegate<ClosedTradesModel> implements ViewModel {
|
class ClosedTradesViewModel extends ActivatableWithDelegate<ClosedTradesModel> implements ViewModel {
|
||||||
|
|
||||||
private final BSFormatter formatter;
|
private final BSFormatter formatter;
|
||||||
|
|
||||||
|
|
||||||
@Inject
|
@Inject
|
||||||
public ClosedTradesPM(ClosedTradesModel model, BSFormatter formatter) {
|
public ClosedTradesViewModel(ClosedTradesModel model, BSFormatter formatter) {
|
||||||
super(model);
|
super(model);
|
||||||
|
|
||||||
this.formatter = formatter;
|
this.formatter = formatter;
|
|
@ -36,7 +36,7 @@ import javafx.util.Callback;
|
||||||
import org.slf4j.Logger;
|
import org.slf4j.Logger;
|
||||||
import org.slf4j.LoggerFactory;
|
import org.slf4j.LoggerFactory;
|
||||||
|
|
||||||
public class OffersView extends ActivatableView<OffersPM> {
|
public class OffersView extends ActivatableView<OffersViewModel> {
|
||||||
private static final Logger log = LoggerFactory.getLogger(OffersView.class);
|
private static final Logger log = LoggerFactory.getLogger(OffersView.class);
|
||||||
|
|
||||||
@FXML TableColumn<OfferListItem, OfferListItem> priceColumn, amountColumn, volumeColumn,
|
@FXML TableColumn<OfferListItem, OfferListItem> priceColumn, amountColumn, volumeColumn,
|
||||||
|
@ -49,7 +49,7 @@ public class OffersView extends ActivatableView<OffersPM> {
|
||||||
///////////////////////////////////////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
@Inject
|
@Inject
|
||||||
private OffersView(OffersPM model) {
|
private OffersView(OffersViewModel model) {
|
||||||
super(model);
|
super(model);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -25,13 +25,13 @@ import com.google.inject.Inject;
|
||||||
|
|
||||||
import javafx.collections.ObservableList;
|
import javafx.collections.ObservableList;
|
||||||
|
|
||||||
class OffersPM extends ActivatableWithDelegate<OffersModel> implements ViewModel {
|
class OffersViewModel extends ActivatableWithDelegate<OffersModel> implements ViewModel {
|
||||||
|
|
||||||
private final BSFormatter formatter;
|
private final BSFormatter formatter;
|
||||||
|
|
||||||
|
|
||||||
@Inject
|
@Inject
|
||||||
public OffersPM(OffersModel model, BSFormatter formatter) {
|
public OffersViewModel(OffersModel model, BSFormatter formatter) {
|
||||||
super(model);
|
super(model);
|
||||||
|
|
||||||
this.formatter = formatter;
|
this.formatter = formatter;
|
|
@ -58,15 +58,15 @@ import javafx.util.StringConverter;
|
||||||
import org.slf4j.Logger;
|
import org.slf4j.Logger;
|
||||||
import org.slf4j.LoggerFactory;
|
import org.slf4j.LoggerFactory;
|
||||||
|
|
||||||
public class PendingTradesView extends ActivatableView<PendingTradesPM> {
|
public class PendingTradesView extends ActivatableView<PendingTradesViewModel> {
|
||||||
private static final Logger log = LoggerFactory.getLogger(PendingTradesView.class);
|
private static final Logger log = LoggerFactory.getLogger(PendingTradesView.class);
|
||||||
|
|
||||||
|
|
||||||
private ChangeListener<PendingTradesListItem> selectedItemChangeListener;
|
private ChangeListener<PendingTradesListItem> selectedItemChangeListener;
|
||||||
private ListChangeListener<PendingTradesListItem> listChangeListener;
|
private ListChangeListener<PendingTradesListItem> listChangeListener;
|
||||||
private ChangeListener<String> txIdChangeListener;
|
private ChangeListener<String> txIdChangeListener;
|
||||||
private ChangeListener<PendingTradesPM.State> offererStateChangeListener;
|
private ChangeListener<PendingTradesViewModel.State> offererStateChangeListener;
|
||||||
private ChangeListener<PendingTradesPM.State> takerStateChangeListener;
|
private ChangeListener<PendingTradesViewModel.State> takerStateChangeListener;
|
||||||
private ChangeListener<Throwable> faultChangeListener;
|
private ChangeListener<Throwable> faultChangeListener;
|
||||||
private final Navigation navigation;
|
private final Navigation navigation;
|
||||||
|
|
||||||
|
@ -99,7 +99,7 @@ public class PendingTradesView extends ActivatableView<PendingTradesPM> {
|
||||||
///////////////////////////////////////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
@Inject
|
@Inject
|
||||||
PendingTradesView(PendingTradesPM model, Navigation navigation) {
|
PendingTradesView(PendingTradesViewModel model, Navigation navigation) {
|
||||||
super(model);
|
super(model);
|
||||||
|
|
||||||
this.navigation = navigation;
|
this.navigation = navigation;
|
||||||
|
@ -290,7 +290,7 @@ public class PendingTradesView extends ActivatableView<PendingTradesPM> {
|
||||||
applyTakerState(model.state.get());
|
applyTakerState(model.state.get());
|
||||||
}
|
}
|
||||||
|
|
||||||
private void applyOffererState(PendingTradesPM.State state) {
|
private void applyOffererState(PendingTradesViewModel.State state) {
|
||||||
setPaymentsControlsVisible(false);
|
setPaymentsControlsVisible(false);
|
||||||
setSummaryControlsVisible(false);
|
setSummaryControlsVisible(false);
|
||||||
|
|
||||||
|
@ -364,7 +364,7 @@ public class PendingTradesView extends ActivatableView<PendingTradesPM> {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
private void applyTakerState(PendingTradesPM.State state) {
|
private void applyTakerState(PendingTradesViewModel.State state) {
|
||||||
confirmPaymentReceiptButton.setVisible(false);
|
confirmPaymentReceiptButton.setVisible(false);
|
||||||
confirmPaymentReceiptButton.setManaged(false);
|
confirmPaymentReceiptButton.setManaged(false);
|
||||||
|
|
||||||
|
|
|
@ -44,8 +44,8 @@ import javafx.collections.ObservableList;
|
||||||
import org.slf4j.Logger;
|
import org.slf4j.Logger;
|
||||||
import org.slf4j.LoggerFactory;
|
import org.slf4j.LoggerFactory;
|
||||||
|
|
||||||
class PendingTradesPM extends ActivatableWithDelegate<PendingTradesModel> implements ViewModel {
|
class PendingTradesViewModel extends ActivatableWithDelegate<PendingTradesModel> implements ViewModel {
|
||||||
private static final Logger log = LoggerFactory.getLogger(PendingTradesPM.class);
|
private static final Logger log = LoggerFactory.getLogger(PendingTradesViewModel.class);
|
||||||
|
|
||||||
enum State {
|
enum State {
|
||||||
TAKER_SELLER_WAIT_TX_CONF,
|
TAKER_SELLER_WAIT_TX_CONF,
|
||||||
|
@ -70,8 +70,8 @@ class PendingTradesPM extends ActivatableWithDelegate<PendingTradesModel> implem
|
||||||
|
|
||||||
|
|
||||||
@Inject
|
@Inject
|
||||||
public PendingTradesPM(PendingTradesModel delegate, BSFormatter formatter,
|
public PendingTradesViewModel(PendingTradesModel delegate, BSFormatter formatter,
|
||||||
BtcAddressValidator btcAddressValidator) {
|
BtcAddressValidator btcAddressValidator) {
|
||||||
super(delegate);
|
super(delegate);
|
||||||
|
|
||||||
this.formatter = formatter;
|
this.formatter = formatter;
|
|
@ -34,7 +34,7 @@ import org.slf4j.LoggerFactory;
|
||||||
/**
|
/**
|
||||||
* This UI is not cached as it is normally only needed once.
|
* This UI is not cached as it is normally only needed once.
|
||||||
*/
|
*/
|
||||||
public class PreferencesView extends ActivatableView<PreferencesPM> {
|
public class PreferencesView extends ActivatableView<PreferencesViewModel> {
|
||||||
|
|
||||||
private static final Logger log = LoggerFactory.getLogger(PreferencesView.class);
|
private static final Logger log = LoggerFactory.getLogger(PreferencesView.class);
|
||||||
|
|
||||||
|
@ -47,7 +47,7 @@ public class PreferencesView extends ActivatableView<PreferencesPM> {
|
||||||
///////////////////////////////////////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
@Inject
|
@Inject
|
||||||
private PreferencesView(PreferencesPM model) {
|
private PreferencesView(PreferencesViewModel model) {
|
||||||
super(model);
|
super(model);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -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 PreferencesPM extends ActivatableWithDelegate<PreferencesModel> implements ViewModel {
|
class PreferencesViewModel extends ActivatableWithDelegate<PreferencesModel> implements ViewModel {
|
||||||
|
|
||||||
@Inject
|
@Inject
|
||||||
public PreferencesPM(PreferencesModel model) {
|
public PreferencesViewModel(PreferencesModel model) {
|
||||||
super(model);
|
super(model);
|
||||||
}
|
}
|
||||||
|
|
|
@ -73,7 +73,7 @@ import static javafx.beans.binding.Bindings.createStringBinding;
|
||||||
// TODO Implement other positioning method in InoutTextField to display it over the field instead of right side
|
// TODO Implement other positioning method in InoutTextField to display it over the field instead of right side
|
||||||
// priceAmountHBox is too large after redesign as to be used as layoutReference.
|
// priceAmountHBox is too large after redesign as to be used as layoutReference.
|
||||||
|
|
||||||
public class CreateOfferView extends ActivatableView<CreateOfferPM> {
|
public class CreateOfferView extends ActivatableView<CreateOfferViewModel> {
|
||||||
private static final Logger log = LoggerFactory.getLogger(CreateOfferView.class);
|
private static final Logger log = LoggerFactory.getLogger(CreateOfferView.class);
|
||||||
|
|
||||||
|
|
||||||
|
@ -117,7 +117,7 @@ public class CreateOfferView extends ActivatableView<CreateOfferPM> {
|
||||||
///////////////////////////////////////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
@Inject
|
@Inject
|
||||||
private CreateOfferView(CreateOfferPM model, Navigation navigation,
|
private CreateOfferView(CreateOfferViewModel model, Navigation navigation,
|
||||||
OverlayManager overlayManager) {
|
OverlayManager overlayManager) {
|
||||||
super(model);
|
super(model);
|
||||||
this.navigation = navigation;
|
this.navigation = navigation;
|
||||||
|
|
|
@ -44,7 +44,7 @@ import javafx.beans.property.StringProperty;
|
||||||
|
|
||||||
import static javafx.beans.binding.Bindings.createStringBinding;
|
import static javafx.beans.binding.Bindings.createStringBinding;
|
||||||
|
|
||||||
class CreateOfferPM extends ActivatableWithDelegate<CreateOfferModel> implements ViewModel {
|
class CreateOfferViewModel extends ActivatableWithDelegate<CreateOfferModel> implements ViewModel {
|
||||||
|
|
||||||
private final BtcValidator btcValidator;
|
private final BtcValidator btcValidator;
|
||||||
private final BSFormatter formatter;
|
private final BSFormatter formatter;
|
||||||
|
@ -93,8 +93,8 @@ class CreateOfferPM extends ActivatableWithDelegate<CreateOfferModel> implements
|
||||||
|
|
||||||
|
|
||||||
@Inject
|
@Inject
|
||||||
public CreateOfferPM(CreateOfferModel model, FiatValidator fiatValidator, BtcValidator btcValidator,
|
public CreateOfferViewModel(CreateOfferModel model, FiatValidator fiatValidator, BtcValidator btcValidator,
|
||||||
BSFormatter formatter) {
|
BSFormatter formatter) {
|
||||||
super(model);
|
super(model);
|
||||||
|
|
||||||
this.fiatValidator = fiatValidator;
|
this.fiatValidator = fiatValidator;
|
|
@ -62,7 +62,7 @@ import static javafx.beans.binding.Bindings.createStringBinding;
|
||||||
* TODO: The advanced filters are not impl. yet
|
* TODO: The advanced filters are not impl. yet
|
||||||
* The restrictions handling is open from the concept and is only implemented for countries yet.
|
* The restrictions handling is open from the concept and is only implemented for countries yet.
|
||||||
*/
|
*/
|
||||||
public class OfferBookView extends ActivatableView<OfferBookPM> {
|
public class OfferBookView extends ActivatableView<OfferBookViewModel> {
|
||||||
private static final Logger log = LoggerFactory.getLogger(OfferBookView.class);
|
private static final Logger log = LoggerFactory.getLogger(OfferBookView.class);
|
||||||
|
|
||||||
private final Navigation navigation;
|
private final Navigation navigation;
|
||||||
|
@ -90,7 +90,7 @@ public class OfferBookView extends ActivatableView<OfferBookPM> {
|
||||||
///////////////////////////////////////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
@Inject
|
@Inject
|
||||||
OfferBookView(OfferBookPM model,
|
OfferBookView(OfferBookViewModel model,
|
||||||
Navigation navigation,
|
Navigation navigation,
|
||||||
OverlayManager overlayManager,
|
OverlayManager overlayManager,
|
||||||
OptionalBtcValidator optionalBtcValidator,
|
OptionalBtcValidator optionalBtcValidator,
|
||||||
|
|
|
@ -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 OfferBookPM extends ActivatableWithDelegate<OfferBookModel> implements ViewModel {
|
class OfferBookViewModel extends ActivatableWithDelegate<OfferBookModel> implements ViewModel {
|
||||||
|
|
||||||
private final OptionalBtcValidator optionalBtcValidator;
|
private final OptionalBtcValidator optionalBtcValidator;
|
||||||
private final BSFormatter formatter;
|
private final BSFormatter formatter;
|
||||||
|
@ -51,8 +51,8 @@ class OfferBookPM extends ActivatableWithDelegate<OfferBookModel> implements Vie
|
||||||
|
|
||||||
|
|
||||||
@Inject
|
@Inject
|
||||||
public OfferBookPM(OfferBookModel delegate, OptionalFiatValidator optionalFiatValidator,
|
public OfferBookViewModel(OfferBookModel delegate, OptionalFiatValidator optionalFiatValidator,
|
||||||
OptionalBtcValidator optionalBtcValidator, BSFormatter formatter) {
|
OptionalBtcValidator optionalBtcValidator, BSFormatter formatter) {
|
||||||
super(delegate);
|
super(delegate);
|
||||||
|
|
||||||
this.optionalFiatValidator = optionalFiatValidator;
|
this.optionalFiatValidator = optionalFiatValidator;
|
|
@ -69,7 +69,7 @@ import org.controlsfx.dialog.Dialog;
|
||||||
import org.slf4j.Logger;
|
import org.slf4j.Logger;
|
||||||
import org.slf4j.LoggerFactory;
|
import org.slf4j.LoggerFactory;
|
||||||
|
|
||||||
public class TakeOfferView extends ActivatableView<TakeOfferPM> {
|
public class TakeOfferView extends ActivatableView<TakeOfferViewModel> {
|
||||||
private static final Logger log = LoggerFactory.getLogger(TakeOfferView.class);
|
private static final Logger log = LoggerFactory.getLogger(TakeOfferView.class);
|
||||||
|
|
||||||
private final Navigation navigation;
|
private final Navigation navigation;
|
||||||
|
@ -112,7 +112,7 @@ public class TakeOfferView extends ActivatableView<TakeOfferPM> {
|
||||||
///////////////////////////////////////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
@Inject
|
@Inject
|
||||||
private TakeOfferView(TakeOfferPM model, Navigation navigation,
|
private TakeOfferView(TakeOfferViewModel model, Navigation navigation,
|
||||||
OverlayManager overlayManager) {
|
OverlayManager overlayManager) {
|
||||||
super(model);
|
super(model);
|
||||||
|
|
||||||
|
|
|
@ -41,7 +41,7 @@ import javafx.beans.property.StringProperty;
|
||||||
|
|
||||||
import static javafx.beans.binding.Bindings.createStringBinding;
|
import static javafx.beans.binding.Bindings.createStringBinding;
|
||||||
|
|
||||||
class TakeOfferPM extends ActivatableWithDelegate<TakeOfferModel> implements ViewModel {
|
class TakeOfferViewModel extends ActivatableWithDelegate<TakeOfferModel> implements ViewModel {
|
||||||
|
|
||||||
private String fiatCode;
|
private String fiatCode;
|
||||||
private String amountRange;
|
private String amountRange;
|
||||||
|
@ -87,7 +87,7 @@ class TakeOfferPM extends ActivatableWithDelegate<TakeOfferModel> implements Vie
|
||||||
|
|
||||||
|
|
||||||
@Inject
|
@Inject
|
||||||
public TakeOfferPM(TakeOfferModel model, BtcValidator btcValidator, BSFormatter formatter) {
|
public TakeOfferViewModel(TakeOfferModel model, BtcValidator btcValidator, BSFormatter formatter) {
|
||||||
super(model);
|
super(model);
|
||||||
|
|
||||||
this.btcValidator = btcValidator;
|
this.btcValidator = btcValidator;
|
|
@ -37,11 +37,11 @@ import org.slf4j.LoggerFactory;
|
||||||
|
|
||||||
import static org.junit.Assert.*;
|
import static org.junit.Assert.*;
|
||||||
|
|
||||||
public class CreateOfferPMTest {
|
public class CreateOfferViewModelTest {
|
||||||
private static final Logger log = LoggerFactory.getLogger(CreateOfferPMTest.class);
|
private static final Logger log = LoggerFactory.getLogger(CreateOfferViewModelTest.class);
|
||||||
|
|
||||||
private CreateOfferModel model;
|
private CreateOfferModel model;
|
||||||
private CreateOfferPM presenter;
|
private CreateOfferViewModel presenter;
|
||||||
|
|
||||||
@Before
|
@Before
|
||||||
public void setup() {
|
public void setup() {
|
||||||
|
@ -50,7 +50,7 @@ public class CreateOfferPMTest {
|
||||||
formatter.setFiatCurrencyCode("USD");
|
formatter.setFiatCurrencyCode("USD");
|
||||||
model = new CreateOfferModel(null, null, null, null, null, null, formatter);
|
model = new CreateOfferModel(null, null, null, null, null, null, formatter);
|
||||||
|
|
||||||
presenter = new CreateOfferPM(model, new FiatValidator(null), new BtcValidator(), formatter);
|
presenter = new CreateOfferViewModel(model, new FiatValidator(null), new BtcValidator(), formatter);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
Loading…
Add table
Add a link
Reference in a new issue