mirror of
https://github.com/bisq-network/bisq.git
synced 2025-02-25 15:29:38 +01:00
Remove section comments from gui model classes
This commit is contained in:
parent
0bf7999e8d
commit
29e0564f5a
30 changed files with 0 additions and 557 deletions
|
@ -30,21 +30,11 @@ class AccountModel extends UIModel {
|
||||||
|
|
||||||
private final User user;
|
private final User user;
|
||||||
|
|
||||||
|
|
||||||
///////////////////////////////////////////////////////////////////////////////////////////
|
|
||||||
// Constructor
|
|
||||||
///////////////////////////////////////////////////////////////////////////////////////////
|
|
||||||
|
|
||||||
@Inject
|
@Inject
|
||||||
private AccountModel(User user) {
|
private AccountModel(User user) {
|
||||||
this.user = user;
|
this.user = user;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
///////////////////////////////////////////////////////////////////////////////////////////
|
|
||||||
// Lifecycle
|
|
||||||
///////////////////////////////////////////////////////////////////////////////////////////
|
|
||||||
|
|
||||||
@SuppressWarnings("EmptyMethod")
|
@SuppressWarnings("EmptyMethod")
|
||||||
@Override
|
@Override
|
||||||
public void initialize() {
|
public void initialize() {
|
||||||
|
@ -69,11 +59,6 @@ class AccountModel extends UIModel {
|
||||||
super.terminate();
|
super.terminate();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
///////////////////////////////////////////////////////////////////////////////////////////
|
|
||||||
// Getters
|
|
||||||
///////////////////////////////////////////////////////////////////////////////////////////
|
|
||||||
|
|
||||||
boolean getNeedRegistration() {
|
boolean getNeedRegistration() {
|
||||||
return user.getAccountId() == null;
|
return user.getAccountId() == null;
|
||||||
|
|
||||||
|
|
|
@ -28,20 +28,12 @@ class AccountPM extends PresentationModel<AccountModel> {
|
||||||
private static final Logger log = LoggerFactory.getLogger(AccountPM.class);
|
private static final Logger log = LoggerFactory.getLogger(AccountPM.class);
|
||||||
|
|
||||||
|
|
||||||
///////////////////////////////////////////////////////////////////////////////////////////
|
|
||||||
// Constructor
|
|
||||||
///////////////////////////////////////////////////////////////////////////////////////////
|
|
||||||
|
|
||||||
@Inject
|
@Inject
|
||||||
private AccountPM(AccountModel model) {
|
private AccountPM(AccountModel model) {
|
||||||
super(model);
|
super(model);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
///////////////////////////////////////////////////////////////////////////////////////////
|
|
||||||
// Lifecycle
|
|
||||||
///////////////////////////////////////////////////////////////////////////////////////////
|
|
||||||
|
|
||||||
@SuppressWarnings("EmptyMethod")
|
@SuppressWarnings("EmptyMethod")
|
||||||
@Override
|
@Override
|
||||||
public void initialize() {
|
public void initialize() {
|
||||||
|
@ -67,10 +59,6 @@ class AccountPM extends PresentationModel<AccountModel> {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
///////////////////////////////////////////////////////////////////////////////////////////
|
|
||||||
// Getters
|
|
||||||
///////////////////////////////////////////////////////////////////////////////////////////
|
|
||||||
|
|
||||||
boolean getNeedRegistration() {
|
boolean getNeedRegistration() {
|
||||||
return model.getNeedRegistration();
|
return model.getNeedRegistration();
|
||||||
}
|
}
|
||||||
|
|
|
@ -27,19 +27,10 @@ import org.slf4j.LoggerFactory;
|
||||||
class ChangePasswordModel extends UIModel {
|
class ChangePasswordModel extends UIModel {
|
||||||
private static final Logger log = LoggerFactory.getLogger(ChangePasswordModel.class);
|
private static final Logger log = LoggerFactory.getLogger(ChangePasswordModel.class);
|
||||||
|
|
||||||
///////////////////////////////////////////////////////////////////////////////////////////
|
|
||||||
// Constructor
|
|
||||||
///////////////////////////////////////////////////////////////////////////////////////////
|
|
||||||
|
|
||||||
@Inject
|
@Inject
|
||||||
private ChangePasswordModel() {
|
private ChangePasswordModel() {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
///////////////////////////////////////////////////////////////////////////////////////////
|
|
||||||
// Lifecycle
|
|
||||||
///////////////////////////////////////////////////////////////////////////////////////////
|
|
||||||
|
|
||||||
@SuppressWarnings("EmptyMethod")
|
@SuppressWarnings("EmptyMethod")
|
||||||
@Override
|
@Override
|
||||||
public void initialize() {
|
public void initialize() {
|
||||||
|
@ -64,11 +55,6 @@ class ChangePasswordModel extends UIModel {
|
||||||
super.terminate();
|
super.terminate();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
///////////////////////////////////////////////////////////////////////////////////////////
|
|
||||||
// Public
|
|
||||||
///////////////////////////////////////////////////////////////////////////////////////////
|
|
||||||
|
|
||||||
@SuppressWarnings("EmptyMethod")
|
@SuppressWarnings("EmptyMethod")
|
||||||
void savePassword(String password) {
|
void savePassword(String password) {
|
||||||
|
|
||||||
|
|
|
@ -43,10 +43,6 @@ class ChangePasswordPM extends PresentationModel<ChangePasswordModel> {
|
||||||
final BooleanProperty saveButtonDisabled = new SimpleBooleanProperty(true);
|
final BooleanProperty saveButtonDisabled = new SimpleBooleanProperty(true);
|
||||||
|
|
||||||
|
|
||||||
///////////////////////////////////////////////////////////////////////////////////////////
|
|
||||||
// Constructor
|
|
||||||
///////////////////////////////////////////////////////////////////////////////////////////
|
|
||||||
|
|
||||||
@Inject
|
@Inject
|
||||||
private ChangePasswordPM(ChangePasswordModel model, PasswordValidator passwordValidator) {
|
private ChangePasswordPM(ChangePasswordModel model, PasswordValidator passwordValidator) {
|
||||||
super(model);
|
super(model);
|
||||||
|
@ -57,10 +53,6 @@ class ChangePasswordPM extends PresentationModel<ChangePasswordModel> {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
///////////////////////////////////////////////////////////////////////////////////////////
|
|
||||||
// Lifecycle
|
|
||||||
///////////////////////////////////////////////////////////////////////////////////////////
|
|
||||||
|
|
||||||
@SuppressWarnings("EmptyMethod")
|
@SuppressWarnings("EmptyMethod")
|
||||||
@Override
|
@Override
|
||||||
public void initialize() {
|
public void initialize() {
|
||||||
|
@ -86,10 +78,6 @@ class ChangePasswordPM extends PresentationModel<ChangePasswordModel> {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
///////////////////////////////////////////////////////////////////////////////////////////
|
|
||||||
// Public
|
|
||||||
///////////////////////////////////////////////////////////////////////////////////////////
|
|
||||||
|
|
||||||
boolean requestSavePassword() {
|
boolean requestSavePassword() {
|
||||||
if (validate()) {
|
if (validate()) {
|
||||||
model.savePassword(passwordField.get());
|
model.savePassword(passwordField.get());
|
||||||
|
@ -103,10 +91,6 @@ class ChangePasswordPM extends PresentationModel<ChangePasswordModel> {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
///////////////////////////////////////////////////////////////////////////////////////////
|
|
||||||
// Private
|
|
||||||
///////////////////////////////////////////////////////////////////////////////////////////
|
|
||||||
|
|
||||||
private boolean validate() {
|
private boolean validate() {
|
||||||
InputValidator.ValidationResult result = passwordValidator.validate(passwordField.get());
|
InputValidator.ValidationResult result = passwordValidator.validate(passwordField.get());
|
||||||
if (result.isValid) {
|
if (result.isValid) {
|
||||||
|
|
|
@ -70,10 +70,6 @@ class FiatAccountModel extends UIModel {
|
||||||
final ObservableList<Region> allRegions = FXCollections.observableArrayList(CountryUtil.getAllRegions());
|
final ObservableList<Region> allRegions = FXCollections.observableArrayList(CountryUtil.getAllRegions());
|
||||||
|
|
||||||
|
|
||||||
///////////////////////////////////////////////////////////////////////////////////////////
|
|
||||||
// Constructor
|
|
||||||
///////////////////////////////////////////////////////////////////////////////////////////
|
|
||||||
|
|
||||||
@Inject
|
@Inject
|
||||||
FiatAccountModel(User user, Persistence persistence, AccountSettings accountSettings) {
|
FiatAccountModel(User user, Persistence persistence, AccountSettings accountSettings) {
|
||||||
this.persistence = persistence;
|
this.persistence = persistence;
|
||||||
|
@ -82,10 +78,6 @@ class FiatAccountModel extends UIModel {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
///////////////////////////////////////////////////////////////////////////////////////////
|
|
||||||
// Lifecycle
|
|
||||||
///////////////////////////////////////////////////////////////////////////////////////////
|
|
||||||
|
|
||||||
@SuppressWarnings("EmptyMethod")
|
@SuppressWarnings("EmptyMethod")
|
||||||
@Override
|
@Override
|
||||||
public void initialize() {
|
public void initialize() {
|
||||||
|
@ -112,10 +104,6 @@ class FiatAccountModel extends UIModel {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
///////////////////////////////////////////////////////////////////////////////////////////
|
|
||||||
// Public
|
|
||||||
///////////////////////////////////////////////////////////////////////////////////////////
|
|
||||||
|
|
||||||
void saveBankAccount() {
|
void saveBankAccount() {
|
||||||
BankAccount bankAccount = new BankAccount(type.get(),
|
BankAccount bankAccount = new BankAccount(type.get(),
|
||||||
currency.get(),
|
currency.get(),
|
||||||
|
@ -168,19 +156,11 @@ class FiatAccountModel extends UIModel {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
///////////////////////////////////////////////////////////////////////////////////////////
|
|
||||||
// Getters
|
|
||||||
///////////////////////////////////////////////////////////////////////////////////////////
|
|
||||||
|
|
||||||
ObservableList<Country> getAllCountriesFor(Region selectedRegion) {
|
ObservableList<Country> getAllCountriesFor(Region selectedRegion) {
|
||||||
return FXCollections.observableArrayList(CountryUtil.getAllCountriesFor(selectedRegion));
|
return FXCollections.observableArrayList(CountryUtil.getAllCountriesFor(selectedRegion));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
///////////////////////////////////////////////////////////////////////////////////////////
|
|
||||||
// Setters
|
|
||||||
///////////////////////////////////////////////////////////////////////////////////////////
|
|
||||||
|
|
||||||
void setType(BankAccountType type) {
|
void setType(BankAccountType type) {
|
||||||
this.type.set(type);
|
this.type.set(type);
|
||||||
|
|
||||||
|
@ -203,10 +183,6 @@ class FiatAccountModel extends UIModel {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
///////////////////////////////////////////////////////////////////////////////////////////
|
|
||||||
// Private methods
|
|
||||||
///////////////////////////////////////////////////////////////////////////////////////////
|
|
||||||
|
|
||||||
private void reset() {
|
private void reset() {
|
||||||
title.set(null);
|
title.set(null);
|
||||||
holderName.set(null);
|
holderName.set(null);
|
||||||
|
|
|
@ -62,10 +62,6 @@ class FiatAccountPm extends PresentationModel<FiatAccountModel> {
|
||||||
final ObjectProperty<Currency> currency = new SimpleObjectProperty<>();
|
final ObjectProperty<Currency> currency = new SimpleObjectProperty<>();
|
||||||
|
|
||||||
|
|
||||||
///////////////////////////////////////////////////////////////////////////////////////////
|
|
||||||
// Constructor
|
|
||||||
///////////////////////////////////////////////////////////////////////////////////////////
|
|
||||||
|
|
||||||
@Inject
|
@Inject
|
||||||
FiatAccountPm(FiatAccountModel model, BankAccountNumberValidator bankAccountNumberValidator) {
|
FiatAccountPm(FiatAccountModel model, BankAccountNumberValidator bankAccountNumberValidator) {
|
||||||
super(model);
|
super(model);
|
||||||
|
@ -73,10 +69,6 @@ class FiatAccountPm extends PresentationModel<FiatAccountModel> {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
///////////////////////////////////////////////////////////////////////////////////////////
|
|
||||||
// Lifecycle
|
|
||||||
///////////////////////////////////////////////////////////////////////////////////////////
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void initialize() {
|
public void initialize() {
|
||||||
// input
|
// input
|
||||||
|
@ -123,10 +115,6 @@ class FiatAccountPm extends PresentationModel<FiatAccountModel> {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
///////////////////////////////////////////////////////////////////////////////////////////
|
|
||||||
// Public
|
|
||||||
///////////////////////////////////////////////////////////////////////////////////////////
|
|
||||||
|
|
||||||
InputValidator.ValidationResult requestSaveBankAccount() {
|
InputValidator.ValidationResult requestSaveBankAccount() {
|
||||||
InputValidator.ValidationResult result = validateInput();
|
InputValidator.ValidationResult result = validateInput();
|
||||||
if (result.isValid) {
|
if (result.isValid) {
|
||||||
|
@ -148,10 +136,6 @@ class FiatAccountPm extends PresentationModel<FiatAccountModel> {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
///////////////////////////////////////////////////////////////////////////////////////////
|
|
||||||
// Converters
|
|
||||||
///////////////////////////////////////////////////////////////////////////////////////////
|
|
||||||
|
|
||||||
StringConverter<BankAccountType> getTypesConverter() {
|
StringConverter<BankAccountType> getTypesConverter() {
|
||||||
return new StringConverter<BankAccountType>() {
|
return new StringConverter<BankAccountType>() {
|
||||||
@Override
|
@Override
|
||||||
|
@ -225,10 +209,6 @@ class FiatAccountPm extends PresentationModel<FiatAccountModel> {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
///////////////////////////////////////////////////////////////////////////////////////////
|
|
||||||
// Getters
|
|
||||||
///////////////////////////////////////////////////////////////////////////////////////////
|
|
||||||
|
|
||||||
ObservableList<BankAccountType> getAllTypes() {
|
ObservableList<BankAccountType> getAllTypes() {
|
||||||
return model.allTypes;
|
return model.allTypes;
|
||||||
}
|
}
|
||||||
|
@ -258,10 +238,6 @@ class FiatAccountPm extends PresentationModel<FiatAccountModel> {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
///////////////////////////////////////////////////////////////////////////////////////////
|
|
||||||
// Setters
|
|
||||||
///////////////////////////////////////////////////////////////////////////////////////////
|
|
||||||
|
|
||||||
void setType(BankAccountType type) {
|
void setType(BankAccountType type) {
|
||||||
model.setType(type);
|
model.setType(type);
|
||||||
validateInput();
|
validateInput();
|
||||||
|
@ -278,10 +254,6 @@ class FiatAccountPm extends PresentationModel<FiatAccountModel> {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
///////////////////////////////////////////////////////////////////////////////////////////
|
|
||||||
// Private methods
|
|
||||||
///////////////////////////////////////////////////////////////////////////////////////////
|
|
||||||
|
|
||||||
private void applyAllBankAccounts() {
|
private void applyAllBankAccounts() {
|
||||||
if (model.allBankAccounts.isEmpty()) {
|
if (model.allBankAccounts.isEmpty()) {
|
||||||
selectionPrompt.set("No bank account available");
|
selectionPrompt.set("No bank account available");
|
||||||
|
|
|
@ -72,10 +72,6 @@ class IrcAccountModel extends UIModel {
|
||||||
final ObservableList<BankAccount> allBankAccounts = FXCollections.observableArrayList();
|
final ObservableList<BankAccount> allBankAccounts = FXCollections.observableArrayList();
|
||||||
|
|
||||||
|
|
||||||
///////////////////////////////////////////////////////////////////////////////////////////
|
|
||||||
// Constructor
|
|
||||||
///////////////////////////////////////////////////////////////////////////////////////////
|
|
||||||
|
|
||||||
@Inject
|
@Inject
|
||||||
IrcAccountModel(User user, Persistence persistence, AccountSettings accountSettings,
|
IrcAccountModel(User user, Persistence persistence, AccountSettings accountSettings,
|
||||||
MessageService messageService) {
|
MessageService messageService) {
|
||||||
|
@ -86,10 +82,6 @@ class IrcAccountModel extends UIModel {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
///////////////////////////////////////////////////////////////////////////////////////////
|
|
||||||
// Lifecycle
|
|
||||||
///////////////////////////////////////////////////////////////////////////////////////////
|
|
||||||
|
|
||||||
@SuppressWarnings("EmptyMethod")
|
@SuppressWarnings("EmptyMethod")
|
||||||
@Override
|
@Override
|
||||||
public void initialize() {
|
public void initialize() {
|
||||||
|
@ -118,10 +110,6 @@ class IrcAccountModel extends UIModel {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
///////////////////////////////////////////////////////////////////////////////////////////
|
|
||||||
// Public
|
|
||||||
///////////////////////////////////////////////////////////////////////////////////////////
|
|
||||||
|
|
||||||
void saveBankAccount() {
|
void saveBankAccount() {
|
||||||
BankAccount bankAccount = new BankAccount(type.get(),
|
BankAccount bankAccount = new BankAccount(type.get(),
|
||||||
currency.get(),
|
currency.get(),
|
||||||
|
@ -137,19 +125,11 @@ class IrcAccountModel extends UIModel {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
///////////////////////////////////////////////////////////////////////////////////////////
|
|
||||||
// Getters
|
|
||||||
///////////////////////////////////////////////////////////////////////////////////////////
|
|
||||||
|
|
||||||
ObservableList<Country> getAllCountriesFor(Region selectedRegion) {
|
ObservableList<Country> getAllCountriesFor(Region selectedRegion) {
|
||||||
return FXCollections.observableArrayList(CountryUtil.getAllCountriesFor(selectedRegion));
|
return FXCollections.observableArrayList(CountryUtil.getAllCountriesFor(selectedRegion));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
///////////////////////////////////////////////////////////////////////////////////////////
|
|
||||||
// Setters
|
|
||||||
///////////////////////////////////////////////////////////////////////////////////////////
|
|
||||||
|
|
||||||
void setType(BankAccountType type) {
|
void setType(BankAccountType type) {
|
||||||
this.type.set(type);
|
this.type.set(type);
|
||||||
}
|
}
|
||||||
|
@ -159,10 +139,6 @@ class IrcAccountModel extends UIModel {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
///////////////////////////////////////////////////////////////////////////////////////////
|
|
||||||
// Private methods
|
|
||||||
///////////////////////////////////////////////////////////////////////////////////////////
|
|
||||||
|
|
||||||
private void reset() {
|
private void reset() {
|
||||||
nickName.set(null);
|
nickName.set(null);
|
||||||
|
|
||||||
|
|
|
@ -51,10 +51,6 @@ class IrcAccountPm extends PresentationModel<IrcAccountModel> {
|
||||||
final ObjectProperty<Currency> currency = new SimpleObjectProperty<>();
|
final ObjectProperty<Currency> currency = new SimpleObjectProperty<>();
|
||||||
|
|
||||||
|
|
||||||
///////////////////////////////////////////////////////////////////////////////////////////
|
|
||||||
// Constructor
|
|
||||||
///////////////////////////////////////////////////////////////////////////////////////////
|
|
||||||
|
|
||||||
@Inject
|
@Inject
|
||||||
IrcAccountPm(IrcAccountModel model, BankAccountNumberValidator nickNameValidator) {
|
IrcAccountPm(IrcAccountModel model, BankAccountNumberValidator nickNameValidator) {
|
||||||
super(model);
|
super(model);
|
||||||
|
@ -62,10 +58,6 @@ class IrcAccountPm extends PresentationModel<IrcAccountModel> {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
///////////////////////////////////////////////////////////////////////////////////////////
|
|
||||||
// Lifecycle
|
|
||||||
///////////////////////////////////////////////////////////////////////////////////////////
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void initialize() {
|
public void initialize() {
|
||||||
// input
|
// input
|
||||||
|
@ -96,10 +88,6 @@ class IrcAccountPm extends PresentationModel<IrcAccountModel> {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
///////////////////////////////////////////////////////////////////////////////////////////
|
|
||||||
// Public
|
|
||||||
///////////////////////////////////////////////////////////////////////////////////////////
|
|
||||||
|
|
||||||
InputValidator.ValidationResult requestSaveBankAccount() {
|
InputValidator.ValidationResult requestSaveBankAccount() {
|
||||||
InputValidator.ValidationResult result = validateInput();
|
InputValidator.ValidationResult result = validateInput();
|
||||||
if (result.isValid) {
|
if (result.isValid) {
|
||||||
|
@ -112,10 +100,6 @@ class IrcAccountPm extends PresentationModel<IrcAccountModel> {
|
||||||
return model.allBankAccounts;
|
return model.allBankAccounts;
|
||||||
}
|
}
|
||||||
|
|
||||||
///////////////////////////////////////////////////////////////////////////////////////////
|
|
||||||
// Converters
|
|
||||||
///////////////////////////////////////////////////////////////////////////////////////////
|
|
||||||
|
|
||||||
StringConverter<BankAccountType> getTypesConverter() {
|
StringConverter<BankAccountType> getTypesConverter() {
|
||||||
return new StringConverter<BankAccountType>() {
|
return new StringConverter<BankAccountType>() {
|
||||||
@Override
|
@Override
|
||||||
|
@ -149,10 +133,6 @@ class IrcAccountPm extends PresentationModel<IrcAccountModel> {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
///////////////////////////////////////////////////////////////////////////////////////////
|
|
||||||
// Getters
|
|
||||||
///////////////////////////////////////////////////////////////////////////////////////////
|
|
||||||
|
|
||||||
ObservableList<BankAccountType> getAllTypes() {
|
ObservableList<BankAccountType> getAllTypes() {
|
||||||
return model.allTypes;
|
return model.allTypes;
|
||||||
}
|
}
|
||||||
|
@ -166,10 +146,6 @@ class IrcAccountPm extends PresentationModel<IrcAccountModel> {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
///////////////////////////////////////////////////////////////////////////////////////////
|
|
||||||
// Setters
|
|
||||||
///////////////////////////////////////////////////////////////////////////////////////////
|
|
||||||
|
|
||||||
void setType(BankAccountType type) {
|
void setType(BankAccountType type) {
|
||||||
model.setType(type);
|
model.setType(type);
|
||||||
validateInput();
|
validateInput();
|
||||||
|
@ -181,10 +157,6 @@ class IrcAccountPm extends PresentationModel<IrcAccountModel> {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
///////////////////////////////////////////////////////////////////////////////////////////
|
|
||||||
// Private methods
|
|
||||||
///////////////////////////////////////////////////////////////////////////////////////////
|
|
||||||
|
|
||||||
|
|
||||||
private InputValidator.ValidationResult validateInput() {
|
private InputValidator.ValidationResult validateInput() {
|
||||||
InputValidator.ValidationResult result = nickNameValidator.validate(model.nickName.get());
|
InputValidator.ValidationResult result = nickNameValidator.validate(model.nickName.get());
|
||||||
|
|
|
@ -28,19 +28,11 @@ class PasswordModel extends UIModel {
|
||||||
private static final Logger log = LoggerFactory.getLogger(PasswordModel.class);
|
private static final Logger log = LoggerFactory.getLogger(PasswordModel.class);
|
||||||
|
|
||||||
|
|
||||||
///////////////////////////////////////////////////////////////////////////////////////////
|
|
||||||
// Constructor
|
|
||||||
///////////////////////////////////////////////////////////////////////////////////////////
|
|
||||||
|
|
||||||
@Inject
|
@Inject
|
||||||
private PasswordModel() {
|
private PasswordModel() {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
///////////////////////////////////////////////////////////////////////////////////////////
|
|
||||||
// Lifecycle
|
|
||||||
///////////////////////////////////////////////////////////////////////////////////////////
|
|
||||||
|
|
||||||
@SuppressWarnings("EmptyMethod")
|
@SuppressWarnings("EmptyMethod")
|
||||||
@Override
|
@Override
|
||||||
public void initialize() {
|
public void initialize() {
|
||||||
|
@ -66,10 +58,6 @@ class PasswordModel extends UIModel {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
///////////////////////////////////////////////////////////////////////////////////////////
|
|
||||||
// Public
|
|
||||||
///////////////////////////////////////////////////////////////////////////////////////////
|
|
||||||
|
|
||||||
@SuppressWarnings("EmptyMethod")
|
@SuppressWarnings("EmptyMethod")
|
||||||
void savePassword(String password) {
|
void savePassword(String password) {
|
||||||
//TODO Implement password encryption for wallet
|
//TODO Implement password encryption for wallet
|
||||||
|
|
|
@ -43,10 +43,6 @@ class PasswordPM extends PresentationModel<PasswordModel> {
|
||||||
final BooleanProperty saveButtonDisabled = new SimpleBooleanProperty(true);
|
final BooleanProperty saveButtonDisabled = new SimpleBooleanProperty(true);
|
||||||
|
|
||||||
|
|
||||||
///////////////////////////////////////////////////////////////////////////////////////////
|
|
||||||
// Constructor
|
|
||||||
///////////////////////////////////////////////////////////////////////////////////////////
|
|
||||||
|
|
||||||
@Inject
|
@Inject
|
||||||
private PasswordPM(PasswordModel model, PasswordValidator passwordValidator) {
|
private PasswordPM(PasswordModel model, PasswordValidator passwordValidator) {
|
||||||
super(model);
|
super(model);
|
||||||
|
@ -57,10 +53,6 @@ class PasswordPM extends PresentationModel<PasswordModel> {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
///////////////////////////////////////////////////////////////////////////////////////////
|
|
||||||
// Lifecycle
|
|
||||||
///////////////////////////////////////////////////////////////////////////////////////////
|
|
||||||
|
|
||||||
@SuppressWarnings("EmptyMethod")
|
@SuppressWarnings("EmptyMethod")
|
||||||
@Override
|
@Override
|
||||||
public void initialize() {
|
public void initialize() {
|
||||||
|
@ -86,10 +78,6 @@ class PasswordPM extends PresentationModel<PasswordModel> {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
///////////////////////////////////////////////////////////////////////////////////////////
|
|
||||||
// Public
|
|
||||||
///////////////////////////////////////////////////////////////////////////////////////////
|
|
||||||
|
|
||||||
boolean requestSavePassword() {
|
boolean requestSavePassword() {
|
||||||
if (validate()) {
|
if (validate()) {
|
||||||
model.savePassword(passwordField.get());
|
model.savePassword(passwordField.get());
|
||||||
|
@ -103,10 +91,6 @@ class PasswordPM extends PresentationModel<PasswordModel> {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
///////////////////////////////////////////////////////////////////////////////////////////
|
|
||||||
// Private
|
|
||||||
///////////////////////////////////////////////////////////////////////////////////////////
|
|
||||||
|
|
||||||
private boolean validate() {
|
private boolean validate() {
|
||||||
InputValidator.ValidationResult result = passwordValidator.validate(passwordField.get());
|
InputValidator.ValidationResult result = passwordValidator.validate(passwordField.get());
|
||||||
if (result.isValid) {
|
if (result.isValid) {
|
||||||
|
|
|
@ -60,10 +60,6 @@ class RegistrationModel extends UIModel {
|
||||||
final StringProperty payFeeErrorMessage = new SimpleStringProperty();
|
final StringProperty payFeeErrorMessage = new SimpleStringProperty();
|
||||||
|
|
||||||
|
|
||||||
///////////////////////////////////////////////////////////////////////////////////////////
|
|
||||||
// Constructor
|
|
||||||
///////////////////////////////////////////////////////////////////////////////////////////
|
|
||||||
|
|
||||||
@Inject
|
@Inject
|
||||||
private RegistrationModel(WalletService walletService, User user, Persistence persistence) {
|
private RegistrationModel(WalletService walletService, User user, Persistence persistence) {
|
||||||
|
|
||||||
|
@ -73,10 +69,6 @@ class RegistrationModel extends UIModel {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
///////////////////////////////////////////////////////////////////////////////////////////
|
|
||||||
// Lifecycle
|
|
||||||
///////////////////////////////////////////////////////////////////////////////////////////
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void initialize() {
|
public void initialize() {
|
||||||
super.initialize();
|
super.initialize();
|
||||||
|
@ -112,10 +104,6 @@ class RegistrationModel extends UIModel {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
///////////////////////////////////////////////////////////////////////////////////////////
|
|
||||||
// Methods
|
|
||||||
///////////////////////////////////////////////////////////////////////////////////////////
|
|
||||||
|
|
||||||
void payFee() {
|
void payFee() {
|
||||||
FutureCallback<Transaction> callback = new FutureCallback<Transaction>() {
|
FutureCallback<Transaction> callback = new FutureCallback<Transaction>() {
|
||||||
@Override
|
@Override
|
||||||
|
@ -147,10 +135,6 @@ class RegistrationModel extends UIModel {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
///////////////////////////////////////////////////////////////////////////////////////////
|
|
||||||
// Getters
|
|
||||||
///////////////////////////////////////////////////////////////////////////////////////////
|
|
||||||
|
|
||||||
WalletService getWalletService() {
|
WalletService getWalletService() {
|
||||||
return walletService;
|
return walletService;
|
||||||
}
|
}
|
||||||
|
@ -168,10 +152,6 @@ class RegistrationModel extends UIModel {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
///////////////////////////////////////////////////////////////////////////////////////////
|
|
||||||
// Private
|
|
||||||
///////////////////////////////////////////////////////////////////////////////////////////
|
|
||||||
|
|
||||||
private void updateBalance(@NotNull Coin balance) {
|
private void updateBalance(@NotNull Coin balance) {
|
||||||
isWalletFunded.set(balance.compareTo(getFeeAsCoin()) >= 0);
|
isWalletFunded.set(balance.compareTo(getFeeAsCoin()) >= 0);
|
||||||
}
|
}
|
||||||
|
|
|
@ -51,10 +51,6 @@ class RegistrationPM extends PresentationModel<RegistrationModel> {
|
||||||
private final BSFormatter formatter;
|
private final BSFormatter formatter;
|
||||||
|
|
||||||
|
|
||||||
///////////////////////////////////////////////////////////////////////////////////////////
|
|
||||||
// Constructor
|
|
||||||
///////////////////////////////////////////////////////////////////////////////////////////
|
|
||||||
|
|
||||||
@Inject
|
@Inject
|
||||||
private RegistrationPM(RegistrationModel model, BSFormatter formatter) {
|
private RegistrationPM(RegistrationModel model, BSFormatter formatter) {
|
||||||
super(model);
|
super(model);
|
||||||
|
@ -62,10 +58,6 @@ class RegistrationPM extends PresentationModel<RegistrationModel> {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
///////////////////////////////////////////////////////////////////////////////////////////
|
|
||||||
// Lifecycle
|
|
||||||
///////////////////////////////////////////////////////////////////////////////////////////
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void initialize() {
|
public void initialize() {
|
||||||
super.initialize();
|
super.initialize();
|
||||||
|
@ -113,10 +105,6 @@ class RegistrationPM extends PresentationModel<RegistrationModel> {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
///////////////////////////////////////////////////////////////////////////////////////////
|
|
||||||
// UI actions
|
|
||||||
///////////////////////////////////////////////////////////////////////////////////////////
|
|
||||||
|
|
||||||
void payFee() {
|
void payFee() {
|
||||||
model.payFeeErrorMessage.set(null);
|
model.payFeeErrorMessage.set(null);
|
||||||
model.payFeeSuccess.set(false);
|
model.payFeeSuccess.set(false);
|
||||||
|
@ -128,10 +116,6 @@ class RegistrationPM extends PresentationModel<RegistrationModel> {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
///////////////////////////////////////////////////////////////////////////////////////////
|
|
||||||
// Getters
|
|
||||||
///////////////////////////////////////////////////////////////////////////////////////////
|
|
||||||
|
|
||||||
WalletService getWalletService() {
|
WalletService getWalletService() {
|
||||||
return model.getWalletService();
|
return model.getWalletService();
|
||||||
}
|
}
|
||||||
|
@ -161,10 +145,6 @@ class RegistrationPM extends PresentationModel<RegistrationModel> {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
///////////////////////////////////////////////////////////////////////////////////////////
|
|
||||||
// Private
|
|
||||||
///////////////////////////////////////////////////////////////////////////////////////////
|
|
||||||
|
|
||||||
private void validateInput() {
|
private void validateInput() {
|
||||||
isPayButtonDisabled.set(!(model.isWalletFunded.get()));
|
isPayButtonDisabled.set(!(model.isWalletFunded.get()));
|
||||||
}
|
}
|
||||||
|
|
|
@ -62,10 +62,6 @@ class RestrictionsModel extends UIModel {
|
||||||
final ObservableList<Region> allRegions = FXCollections.observableArrayList(CountryUtil.getAllRegions());
|
final ObservableList<Region> allRegions = FXCollections.observableArrayList(CountryUtil.getAllRegions());
|
||||||
|
|
||||||
|
|
||||||
///////////////////////////////////////////////////////////////////////////////////////////
|
|
||||||
// Constructor
|
|
||||||
///////////////////////////////////////////////////////////////////////////////////////////
|
|
||||||
|
|
||||||
@Inject
|
@Inject
|
||||||
private RestrictionsModel(User user, AccountSettings accountSettings, Persistence persistence,
|
private RestrictionsModel(User user, AccountSettings accountSettings, Persistence persistence,
|
||||||
MessageService messageService) {
|
MessageService messageService) {
|
||||||
|
@ -76,10 +72,6 @@ class RestrictionsModel extends UIModel {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
///////////////////////////////////////////////////////////////////////////////////////////
|
|
||||||
// Lifecycle
|
|
||||||
///////////////////////////////////////////////////////////////////////////////////////////
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void initialize() {
|
public void initialize() {
|
||||||
super.initialize();
|
super.initialize();
|
||||||
|
@ -123,10 +115,6 @@ class RestrictionsModel extends UIModel {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
///////////////////////////////////////////////////////////////////////////////////////////
|
|
||||||
// Public
|
|
||||||
///////////////////////////////////////////////////////////////////////////////////////////
|
|
||||||
|
|
||||||
ObservableList<Country> getAllCountriesFor(Region selectedRegion) {
|
ObservableList<Country> getAllCountriesFor(Region selectedRegion) {
|
||||||
return FXCollections.observableArrayList(CountryUtil.getAllCountriesFor(selectedRegion));
|
return FXCollections.observableArrayList(CountryUtil.getAllCountriesFor(selectedRegion));
|
||||||
}
|
}
|
||||||
|
@ -178,10 +166,6 @@ class RestrictionsModel extends UIModel {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
///////////////////////////////////////////////////////////////////////////////////////////
|
|
||||||
// Private
|
|
||||||
///////////////////////////////////////////////////////////////////////////////////////////
|
|
||||||
|
|
||||||
private void saveSettings() {
|
private void saveSettings() {
|
||||||
persistence.write(accountSettings);
|
persistence.write(accountSettings);
|
||||||
}
|
}
|
||||||
|
|
|
@ -39,20 +39,12 @@ class RestrictionsPM extends PresentationModel<RestrictionsModel> {
|
||||||
final BooleanProperty doneButtonDisable = new SimpleBooleanProperty(true);
|
final BooleanProperty doneButtonDisable = new SimpleBooleanProperty(true);
|
||||||
|
|
||||||
|
|
||||||
///////////////////////////////////////////////////////////////////////////////////////////
|
|
||||||
// Constructor
|
|
||||||
///////////////////////////////////////////////////////////////////////////////////////////
|
|
||||||
|
|
||||||
@Inject
|
@Inject
|
||||||
private RestrictionsPM(RestrictionsModel model) {
|
private RestrictionsPM(RestrictionsModel model) {
|
||||||
super(model);
|
super(model);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
///////////////////////////////////////////////////////////////////////////////////////////
|
|
||||||
// Lifecycle
|
|
||||||
///////////////////////////////////////////////////////////////////////////////////////////
|
|
||||||
|
|
||||||
@SuppressWarnings("EmptyMethod")
|
@SuppressWarnings("EmptyMethod")
|
||||||
@Override
|
@Override
|
||||||
public void initialize() {
|
public void initialize() {
|
||||||
|
@ -74,10 +66,6 @@ class RestrictionsPM extends PresentationModel<RestrictionsModel> {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
///////////////////////////////////////////////////////////////////////////////////////////
|
|
||||||
// Public
|
|
||||||
///////////////////////////////////////////////////////////////////////////////////////////
|
|
||||||
|
|
||||||
void addLanguage(Locale locale) {
|
void addLanguage(Locale locale) {
|
||||||
model.addLanguage(locale);
|
model.addLanguage(locale);
|
||||||
updateDoneButtonDisableState();
|
updateDoneButtonDisableState();
|
||||||
|
@ -109,10 +97,6 @@ class RestrictionsPM extends PresentationModel<RestrictionsModel> {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
///////////////////////////////////////////////////////////////////////////////////////////
|
|
||||||
// Getters
|
|
||||||
///////////////////////////////////////////////////////////////////////////////////////////
|
|
||||||
|
|
||||||
ObservableList<Country> getListWithAllEuroCountries() {
|
ObservableList<Country> getListWithAllEuroCountries() {
|
||||||
return model.getListWithAllEuroCountries();
|
return model.getListWithAllEuroCountries();
|
||||||
}
|
}
|
||||||
|
@ -142,10 +126,6 @@ class RestrictionsPM extends PresentationModel<RestrictionsModel> {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
///////////////////////////////////////////////////////////////////////////////////////////
|
|
||||||
// Private
|
|
||||||
///////////////////////////////////////////////////////////////////////////////////////////
|
|
||||||
|
|
||||||
//TODO Revert size() > -1 to 0(2 later). For mock testing disabled arbitratorList test
|
//TODO Revert size() > -1 to 0(2 later). For mock testing disabled arbitratorList test
|
||||||
private void updateDoneButtonDisableState() {
|
private void updateDoneButtonDisableState() {
|
||||||
boolean isValid = model.languageList != null && model.languageList.size() > 0 &&
|
boolean isValid = model.languageList != null && model.languageList.size() > 0 &&
|
||||||
|
|
|
@ -33,10 +33,6 @@ class SeedWordsModel extends UIModel {
|
||||||
private List<String> mnemonicCode;
|
private List<String> mnemonicCode;
|
||||||
|
|
||||||
|
|
||||||
///////////////////////////////////////////////////////////////////////////////////////////
|
|
||||||
// Constructor
|
|
||||||
///////////////////////////////////////////////////////////////////////////////////////////
|
|
||||||
|
|
||||||
@Inject
|
@Inject
|
||||||
private SeedWordsModel(WalletService walletService) {
|
private SeedWordsModel(WalletService walletService) {
|
||||||
if (walletService != null && walletService.getWallet() != null)
|
if (walletService != null && walletService.getWallet() != null)
|
||||||
|
@ -44,10 +40,6 @@ class SeedWordsModel extends UIModel {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
///////////////////////////////////////////////////////////////////////////////////////////
|
|
||||||
// Lifecycle
|
|
||||||
///////////////////////////////////////////////////////////////////////////////////////////
|
|
||||||
|
|
||||||
@SuppressWarnings("EmptyMethod")
|
@SuppressWarnings("EmptyMethod")
|
||||||
@Override
|
@Override
|
||||||
public void initialize() {
|
public void initialize() {
|
||||||
|
@ -73,10 +65,6 @@ class SeedWordsModel extends UIModel {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
///////////////////////////////////////////////////////////////////////////////////////////
|
|
||||||
// Getter
|
|
||||||
///////////////////////////////////////////////////////////////////////////////////////////
|
|
||||||
|
|
||||||
List<String> getMnemonicCode() {
|
List<String> getMnemonicCode() {
|
||||||
return mnemonicCode;
|
return mnemonicCode;
|
||||||
}
|
}
|
||||||
|
|
|
@ -35,10 +35,6 @@ class SeedWordsPM extends PresentationModel<SeedWordsModel> {
|
||||||
private final BSFormatter formatter;
|
private final BSFormatter formatter;
|
||||||
|
|
||||||
|
|
||||||
///////////////////////////////////////////////////////////////////////////////////////////
|
|
||||||
// Constructor
|
|
||||||
///////////////////////////////////////////////////////////////////////////////////////////
|
|
||||||
|
|
||||||
@Inject
|
@Inject
|
||||||
private SeedWordsPM(SeedWordsModel model, BSFormatter formatter) {
|
private SeedWordsPM(SeedWordsModel model, BSFormatter formatter) {
|
||||||
super(model);
|
super(model);
|
||||||
|
@ -46,10 +42,6 @@ class SeedWordsPM extends PresentationModel<SeedWordsModel> {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
///////////////////////////////////////////////////////////////////////////////////////////
|
|
||||||
// Lifecycle
|
|
||||||
///////////////////////////////////////////////////////////////////////////////////////////
|
|
||||||
|
|
||||||
@SuppressWarnings("EmptyMethod")
|
@SuppressWarnings("EmptyMethod")
|
||||||
@Override
|
@Override
|
||||||
public void initialize() {
|
public void initialize() {
|
||||||
|
|
|
@ -43,10 +43,6 @@ class ClosedTradesModel extends UIModel {
|
||||||
private MapChangeListener<String, Trade> mapChangeListener;
|
private MapChangeListener<String, Trade> mapChangeListener;
|
||||||
|
|
||||||
|
|
||||||
///////////////////////////////////////////////////////////////////////////////////////////
|
|
||||||
// Constructor
|
|
||||||
///////////////////////////////////////////////////////////////////////////////////////////
|
|
||||||
|
|
||||||
@Inject
|
@Inject
|
||||||
public ClosedTradesModel(TradeManager tradeManager, User user) {
|
public ClosedTradesModel(TradeManager tradeManager, User user) {
|
||||||
this.tradeManager = tradeManager;
|
this.tradeManager = tradeManager;
|
||||||
|
@ -54,10 +50,6 @@ class ClosedTradesModel extends UIModel {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
///////////////////////////////////////////////////////////////////////////////////////////
|
|
||||||
// Lifecycle
|
|
||||||
///////////////////////////////////////////////////////////////////////////////////////////
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void initialize() {
|
public void initialize() {
|
||||||
mapChangeListener = change -> {
|
mapChangeListener = change -> {
|
||||||
|
@ -97,10 +89,6 @@ class ClosedTradesModel extends UIModel {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
///////////////////////////////////////////////////////////////////////////////////////////
|
|
||||||
// Getters
|
|
||||||
///////////////////////////////////////////////////////////////////////////////////////////
|
|
||||||
|
|
||||||
public ObservableList<ClosedTradesListItem> getList() {
|
public ObservableList<ClosedTradesListItem> getList() {
|
||||||
return list;
|
return list;
|
||||||
}
|
}
|
||||||
|
|
|
@ -33,10 +33,6 @@ class ClosedTradesPM extends PresentationModel<ClosedTradesModel> {
|
||||||
private final BSFormatter formatter;
|
private final BSFormatter formatter;
|
||||||
|
|
||||||
|
|
||||||
///////////////////////////////////////////////////////////////////////////////////////////
|
|
||||||
// Constructor
|
|
||||||
///////////////////////////////////////////////////////////////////////////////////////////
|
|
||||||
|
|
||||||
@Inject
|
@Inject
|
||||||
public ClosedTradesPM(ClosedTradesModel model, BSFormatter formatter) {
|
public ClosedTradesPM(ClosedTradesModel model, BSFormatter formatter) {
|
||||||
super(model);
|
super(model);
|
||||||
|
@ -45,10 +41,6 @@ class ClosedTradesPM extends PresentationModel<ClosedTradesModel> {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
///////////////////////////////////////////////////////////////////////////////////////////
|
|
||||||
// Lifecycle
|
|
||||||
///////////////////////////////////////////////////////////////////////////////////////////
|
|
||||||
|
|
||||||
@SuppressWarnings("EmptyMethod")
|
@SuppressWarnings("EmptyMethod")
|
||||||
@Override
|
@Override
|
||||||
public void initialize() {
|
public void initialize() {
|
||||||
|
@ -74,10 +66,6 @@ class ClosedTradesPM extends PresentationModel<ClosedTradesModel> {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
///////////////////////////////////////////////////////////////////////////////////////////
|
|
||||||
// Getters
|
|
||||||
///////////////////////////////////////////////////////////////////////////////////////////
|
|
||||||
|
|
||||||
public ObservableList<ClosedTradesListItem> getList() {
|
public ObservableList<ClosedTradesListItem> getList() {
|
||||||
return model.getList();
|
return model.getList();
|
||||||
}
|
}
|
||||||
|
|
|
@ -44,10 +44,6 @@ class OffersModel extends UIModel {
|
||||||
private MapChangeListener<String, Offer> offerMapChangeListener;
|
private MapChangeListener<String, Offer> offerMapChangeListener;
|
||||||
|
|
||||||
|
|
||||||
///////////////////////////////////////////////////////////////////////////////////////////
|
|
||||||
// Constructor
|
|
||||||
///////////////////////////////////////////////////////////////////////////////////////////
|
|
||||||
|
|
||||||
@Inject
|
@Inject
|
||||||
public OffersModel(TradeManager tradeManager, User user) {
|
public OffersModel(TradeManager tradeManager, User user) {
|
||||||
this.tradeManager = tradeManager;
|
this.tradeManager = tradeManager;
|
||||||
|
@ -55,10 +51,6 @@ class OffersModel extends UIModel {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
///////////////////////////////////////////////////////////////////////////////////////////
|
|
||||||
// Lifecycle
|
|
||||||
///////////////////////////////////////////////////////////////////////////////////////////
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void initialize() {
|
public void initialize() {
|
||||||
offerMapChangeListener = change -> {
|
offerMapChangeListener = change -> {
|
||||||
|
@ -98,19 +90,11 @@ class OffersModel extends UIModel {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
///////////////////////////////////////////////////////////////////////////////////////////
|
|
||||||
// Public methods
|
|
||||||
///////////////////////////////////////////////////////////////////////////////////////////
|
|
||||||
|
|
||||||
void removeOffer(OfferListItem item) {
|
void removeOffer(OfferListItem item) {
|
||||||
tradeManager.removeOffer(item.getOffer());
|
tradeManager.removeOffer(item.getOffer());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
///////////////////////////////////////////////////////////////////////////////////////////
|
|
||||||
// Getters
|
|
||||||
///////////////////////////////////////////////////////////////////////////////////////////
|
|
||||||
|
|
||||||
public ObservableList<OfferListItem> getList() {
|
public ObservableList<OfferListItem> getList() {
|
||||||
return list;
|
return list;
|
||||||
}
|
}
|
||||||
|
|
|
@ -33,10 +33,6 @@ class OffersPM extends PresentationModel<OffersModel> {
|
||||||
private final BSFormatter formatter;
|
private final BSFormatter formatter;
|
||||||
|
|
||||||
|
|
||||||
///////////////////////////////////////////////////////////////////////////////////////////
|
|
||||||
// Constructor
|
|
||||||
///////////////////////////////////////////////////////////////////////////////////////////
|
|
||||||
|
|
||||||
@Inject
|
@Inject
|
||||||
public OffersPM(OffersModel model, BSFormatter formatter) {
|
public OffersPM(OffersModel model, BSFormatter formatter) {
|
||||||
super(model);
|
super(model);
|
||||||
|
@ -45,10 +41,6 @@ class OffersPM extends PresentationModel<OffersModel> {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
///////////////////////////////////////////////////////////////////////////////////////////
|
|
||||||
// Lifecycle
|
|
||||||
///////////////////////////////////////////////////////////////////////////////////////////
|
|
||||||
|
|
||||||
@SuppressWarnings("EmptyMethod")
|
@SuppressWarnings("EmptyMethod")
|
||||||
@Override
|
@Override
|
||||||
public void initialize() {
|
public void initialize() {
|
||||||
|
@ -74,19 +66,11 @@ class OffersPM extends PresentationModel<OffersModel> {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
///////////////////////////////////////////////////////////////////////////////////////////
|
|
||||||
// Public methods
|
|
||||||
///////////////////////////////////////////////////////////////////////////////////////////
|
|
||||||
|
|
||||||
void removeOffer(OfferListItem item) {
|
void removeOffer(OfferListItem item) {
|
||||||
model.removeOffer(item);
|
model.removeOffer(item);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
///////////////////////////////////////////////////////////////////////////////////////////
|
|
||||||
// Getters
|
|
||||||
///////////////////////////////////////////////////////////////////////////////////////////
|
|
||||||
|
|
||||||
public ObservableList<OfferListItem> getList() {
|
public ObservableList<OfferListItem> getList() {
|
||||||
return model.getList();
|
return model.getList();
|
||||||
}
|
}
|
||||||
|
|
|
@ -77,10 +77,6 @@ class PendingTradesModel extends UIModel {
|
||||||
final ObjectProperty<Throwable> fault = new SimpleObjectProperty<>();
|
final ObjectProperty<Throwable> fault = new SimpleObjectProperty<>();
|
||||||
|
|
||||||
|
|
||||||
///////////////////////////////////////////////////////////////////////////////////////////
|
|
||||||
// Constructor
|
|
||||||
///////////////////////////////////////////////////////////////////////////////////////////
|
|
||||||
|
|
||||||
@Inject
|
@Inject
|
||||||
PendingTradesModel(TradeManager tradeManager, WalletService walletService, User user) {
|
PendingTradesModel(TradeManager tradeManager, WalletService walletService, User user) {
|
||||||
this.tradeManager = tradeManager;
|
this.tradeManager = tradeManager;
|
||||||
|
@ -89,10 +85,6 @@ class PendingTradesModel extends UIModel {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
///////////////////////////////////////////////////////////////////////////////////////////
|
|
||||||
// Lifecycle
|
|
||||||
///////////////////////////////////////////////////////////////////////////////////////////
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void initialize() {
|
public void initialize() {
|
||||||
stateChangeListener = (ov, oldValue, newValue) -> tradeState.set(newValue);
|
stateChangeListener = (ov, oldValue, newValue) -> tradeState.set(newValue);
|
||||||
|
@ -143,10 +135,6 @@ class PendingTradesModel extends UIModel {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
///////////////////////////////////////////////////////////////////////////////////////////
|
|
||||||
// Methods
|
|
||||||
///////////////////////////////////////////////////////////////////////////////////////////
|
|
||||||
|
|
||||||
void selectTrade(PendingTradesListItem item) {
|
void selectTrade(PendingTradesListItem item) {
|
||||||
// clean up previous selectedItem
|
// clean up previous selectedItem
|
||||||
cleanUpSelectedTrade();
|
cleanUpSelectedTrade();
|
||||||
|
@ -249,10 +237,6 @@ class PendingTradesModel extends UIModel {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
///////////////////////////////////////////////////////////////////////////////////////////
|
|
||||||
// Getters
|
|
||||||
///////////////////////////////////////////////////////////////////////////////////////////
|
|
||||||
|
|
||||||
ObservableList<PendingTradesListItem> getList() {
|
ObservableList<PendingTradesListItem> getList() {
|
||||||
return list;
|
return list;
|
||||||
}
|
}
|
||||||
|
@ -301,10 +285,6 @@ class PendingTradesModel extends UIModel {
|
||||||
return getTrade().getSecurityDeposit();
|
return getTrade().getSecurityDeposit();
|
||||||
}
|
}
|
||||||
|
|
||||||
///////////////////////////////////////////////////////////////////////////////////////////
|
|
||||||
// Private
|
|
||||||
///////////////////////////////////////////////////////////////////////////////////////////
|
|
||||||
|
|
||||||
private void updateConfidence(TransactionConfidence confidence) {
|
private void updateConfidence(TransactionConfidence confidence) {
|
||||||
log.trace("updateConfidence confidence " + confidence);
|
log.trace("updateConfidence confidence " + confidence);
|
||||||
log.trace("updateConfidence getTrade().getState() " + getTrade().getState());
|
log.trace("updateConfidence getTrade().getState() " + getTrade().getState());
|
||||||
|
|
|
@ -68,10 +68,6 @@ public class PendingTradesPM extends PresentationModel<PendingTradesModel> {
|
||||||
final BooleanProperty withdrawalButtonDisable = new SimpleBooleanProperty(true);
|
final BooleanProperty withdrawalButtonDisable = new SimpleBooleanProperty(true);
|
||||||
|
|
||||||
|
|
||||||
///////////////////////////////////////////////////////////////////////////////////////////
|
|
||||||
// Constructor
|
|
||||||
///////////////////////////////////////////////////////////////////////////////////////////
|
|
||||||
|
|
||||||
@Inject
|
@Inject
|
||||||
PendingTradesPM(PendingTradesModel model, BSFormatter formatter,
|
PendingTradesPM(PendingTradesModel model, BSFormatter formatter,
|
||||||
BtcAddressValidator btcAddressValidator) {
|
BtcAddressValidator btcAddressValidator) {
|
||||||
|
@ -82,10 +78,6 @@ public class PendingTradesPM extends PresentationModel<PendingTradesModel> {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
///////////////////////////////////////////////////////////////////////////////////////////
|
|
||||||
// Lifecycle
|
|
||||||
///////////////////////////////////////////////////////////////////////////////////////////
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void initialize() {
|
public void initialize() {
|
||||||
stateChangeListener = (ov) -> updateState();
|
stateChangeListener = (ov) -> updateState();
|
||||||
|
@ -116,10 +108,6 @@ public class PendingTradesPM extends PresentationModel<PendingTradesModel> {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
///////////////////////////////////////////////////////////////////////////////////////////
|
|
||||||
// Methods
|
|
||||||
///////////////////////////////////////////////////////////////////////////////////////////
|
|
||||||
|
|
||||||
void selectTrade(PendingTradesListItem item) {
|
void selectTrade(PendingTradesListItem item) {
|
||||||
model.selectTrade(item);
|
model.selectTrade(item);
|
||||||
updateState();
|
updateState();
|
||||||
|
@ -145,10 +133,6 @@ public class PendingTradesPM extends PresentationModel<PendingTradesModel> {
|
||||||
return formatter.formatCoinWithCode(model.getAmountToWithdraw()); //.subtract(FeePolicy.TX_FEE));
|
return formatter.formatCoinWithCode(model.getAmountToWithdraw()); //.subtract(FeePolicy.TX_FEE));
|
||||||
}
|
}
|
||||||
|
|
||||||
///////////////////////////////////////////////////////////////////////////////////////////
|
|
||||||
// Getters
|
|
||||||
///////////////////////////////////////////////////////////////////////////////////////////
|
|
||||||
|
|
||||||
ObservableList<PendingTradesListItem> getList() {
|
ObservableList<PendingTradesListItem> getList() {
|
||||||
return model.getList();
|
return model.getList();
|
||||||
}
|
}
|
||||||
|
@ -242,10 +226,6 @@ public class PendingTradesPM extends PresentationModel<PendingTradesModel> {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
///////////////////////////////////////////////////////////////////////////////////////////
|
|
||||||
// Private
|
|
||||||
///////////////////////////////////////////////////////////////////////////////////////////
|
|
||||||
|
|
||||||
private void updateState() {
|
private void updateState() {
|
||||||
Trade.State tradeState = model.tradeState.get();
|
Trade.State tradeState = model.tradeState.get();
|
||||||
log.trace("tradeState " + tradeState);
|
log.trace("tradeState " + tradeState);
|
||||||
|
|
|
@ -49,10 +49,6 @@ class PreferencesModel extends UIModel {
|
||||||
final StringProperty btcDenomination = new SimpleStringProperty();
|
final StringProperty btcDenomination = new SimpleStringProperty();
|
||||||
|
|
||||||
|
|
||||||
///////////////////////////////////////////////////////////////////////////////////////////
|
|
||||||
// Constructor
|
|
||||||
///////////////////////////////////////////////////////////////////////////////////////////
|
|
||||||
|
|
||||||
@Inject
|
@Inject
|
||||||
PreferencesModel(Preferences preferences) {
|
PreferencesModel(Preferences preferences) {
|
||||||
this.preferences = preferences;
|
this.preferences = preferences;
|
||||||
|
@ -64,10 +60,6 @@ class PreferencesModel extends UIModel {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
///////////////////////////////////////////////////////////////////////////////////////////
|
|
||||||
// Lifecycle
|
|
||||||
///////////////////////////////////////////////////////////////////////////////////////////
|
|
||||||
|
|
||||||
@SuppressWarnings("EmptyMethod")
|
@SuppressWarnings("EmptyMethod")
|
||||||
@Override
|
@Override
|
||||||
public void initialize() {
|
public void initialize() {
|
||||||
|
|
|
@ -32,20 +32,12 @@ public class PreferencesPM extends PresentationModel<PreferencesModel> {
|
||||||
private static final Logger log = LoggerFactory.getLogger(PreferencesPM.class);
|
private static final Logger log = LoggerFactory.getLogger(PreferencesPM.class);
|
||||||
|
|
||||||
|
|
||||||
///////////////////////////////////////////////////////////////////////////////////////////
|
|
||||||
// Constructor
|
|
||||||
///////////////////////////////////////////////////////////////////////////////////////////
|
|
||||||
|
|
||||||
@Inject
|
@Inject
|
||||||
PreferencesPM(PreferencesModel model) {
|
PreferencesPM(PreferencesModel model) {
|
||||||
super(model);
|
super(model);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
///////////////////////////////////////////////////////////////////////////////////////////
|
|
||||||
// Lifecycle
|
|
||||||
///////////////////////////////////////////////////////////////////////////////////////////
|
|
||||||
|
|
||||||
@SuppressWarnings("EmptyMethod")
|
@SuppressWarnings("EmptyMethod")
|
||||||
@Override
|
@Override
|
||||||
public void initialize() {
|
public void initialize() {
|
||||||
|
@ -71,14 +63,6 @@ public class PreferencesPM extends PresentationModel<PreferencesModel> {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
///////////////////////////////////////////////////////////////////////////////////////////
|
|
||||||
// Methods
|
|
||||||
///////////////////////////////////////////////////////////////////////////////////////////
|
|
||||||
|
|
||||||
|
|
||||||
///////////////////////////////////////////////////////////////////////////////////////////
|
|
||||||
// Getters
|
|
||||||
///////////////////////////////////////////////////////////////////////////////////////////
|
|
||||||
|
|
||||||
public ObservableList<String> getBtcDenominationItems() {
|
public ObservableList<String> getBtcDenominationItems() {
|
||||||
return model.btcDenominations;
|
return model.btcDenominations;
|
||||||
|
@ -97,9 +81,5 @@ public class PreferencesPM extends PresentationModel<PreferencesModel> {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
///////////////////////////////////////////////////////////////////////////////////////////
|
|
||||||
// Private
|
|
||||||
///////////////////////////////////////////////////////////////////////////////////////////
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -106,10 +106,6 @@ class CreateOfferModel extends UIModel {
|
||||||
final ObservableList<Arbitrator> acceptedArbitrators = FXCollections.observableArrayList();
|
final ObservableList<Arbitrator> acceptedArbitrators = FXCollections.observableArrayList();
|
||||||
|
|
||||||
|
|
||||||
///////////////////////////////////////////////////////////////////////////////////////////
|
|
||||||
// Constructor
|
|
||||||
///////////////////////////////////////////////////////////////////////////////////////////
|
|
||||||
|
|
||||||
// non private for testing
|
// non private for testing
|
||||||
@Inject
|
@Inject
|
||||||
public CreateOfferModel(TradeManager tradeManager, WalletService walletService, AccountSettings accountSettings,
|
public CreateOfferModel(TradeManager tradeManager, WalletService walletService, AccountSettings accountSettings,
|
||||||
|
@ -127,10 +123,6 @@ class CreateOfferModel extends UIModel {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
///////////////////////////////////////////////////////////////////////////////////////////
|
|
||||||
// Lifecycle
|
|
||||||
///////////////////////////////////////////////////////////////////////////////////////////
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void initialize() {
|
public void initialize() {
|
||||||
// static data
|
// static data
|
||||||
|
@ -194,10 +186,6 @@ class CreateOfferModel extends UIModel {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
///////////////////////////////////////////////////////////////////////////////////////////
|
|
||||||
// Methods
|
|
||||||
///////////////////////////////////////////////////////////////////////////////////////////
|
|
||||||
|
|
||||||
void placeOffer() {
|
void placeOffer() {
|
||||||
// data validation is done in the trade domain
|
// data validation is done in the trade domain
|
||||||
tradeManager.requestPlaceOffer(offerId,
|
tradeManager.requestPlaceOffer(offerId,
|
||||||
|
@ -264,10 +252,6 @@ class CreateOfferModel extends UIModel {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
///////////////////////////////////////////////////////////////////////////////////////////
|
|
||||||
// Setter/Getter
|
|
||||||
///////////////////////////////////////////////////////////////////////////////////////////
|
|
||||||
|
|
||||||
@Nullable
|
@Nullable
|
||||||
Direction getDirection() {
|
Direction getDirection() {
|
||||||
return direction;
|
return direction;
|
||||||
|
@ -297,10 +281,6 @@ class CreateOfferModel extends UIModel {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
///////////////////////////////////////////////////////////////////////////////////////////
|
|
||||||
// Private
|
|
||||||
///////////////////////////////////////////////////////////////////////////////////////////
|
|
||||||
|
|
||||||
|
|
||||||
private void updateBalance(@NotNull Coin balance) {
|
private void updateBalance(@NotNull Coin balance) {
|
||||||
isWalletFunded.set(totalToPayAsCoin.get() != null && balance.compareTo(totalToPayAsCoin.get()) >= 0);
|
isWalletFunded.set(totalToPayAsCoin.get() != null && balance.compareTo(totalToPayAsCoin.get()) >= 0);
|
||||||
|
|
|
@ -95,10 +95,6 @@ class CreateOfferPM extends PresentationModel<CreateOfferModel> {
|
||||||
final ObjectProperty<Address> address = new SimpleObjectProperty<>();
|
final ObjectProperty<Address> address = new SimpleObjectProperty<>();
|
||||||
|
|
||||||
|
|
||||||
///////////////////////////////////////////////////////////////////////////////////////////
|
|
||||||
// Constructor
|
|
||||||
///////////////////////////////////////////////////////////////////////////////////////////
|
|
||||||
|
|
||||||
// non private for testing
|
// non private for testing
|
||||||
@Inject
|
@Inject
|
||||||
CreateOfferPM(CreateOfferModel model, FiatValidator fiatValidator, BtcValidator btcValidator,
|
CreateOfferPM(CreateOfferModel model, FiatValidator fiatValidator, BtcValidator btcValidator,
|
||||||
|
@ -111,10 +107,6 @@ class CreateOfferPM extends PresentationModel<CreateOfferModel> {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
///////////////////////////////////////////////////////////////////////////////////////////
|
|
||||||
// Lifecycle
|
|
||||||
///////////////////////////////////////////////////////////////////////////////////////////
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void initialize() {
|
public void initialize() {
|
||||||
super.initialize();
|
super.initialize();
|
||||||
|
@ -150,10 +142,6 @@ class CreateOfferPM extends PresentationModel<CreateOfferModel> {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
///////////////////////////////////////////////////////////////////////////////////////////
|
|
||||||
// Public API methods
|
|
||||||
///////////////////////////////////////////////////////////////////////////////////////////
|
|
||||||
|
|
||||||
// setOfferBookFilter is a one time call
|
// setOfferBookFilter is a one time call
|
||||||
void initWithData(Direction direction, Coin amount, Fiat price) {
|
void initWithData(Direction direction, Coin amount, Fiat price) {
|
||||||
model.setDirection(direction);
|
model.setDirection(direction);
|
||||||
|
@ -181,10 +169,6 @@ class CreateOfferPM extends PresentationModel<CreateOfferModel> {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
///////////////////////////////////////////////////////////////////////////////////////////
|
|
||||||
// UI actions
|
|
||||||
///////////////////////////////////////////////////////////////////////////////////////////
|
|
||||||
|
|
||||||
void placeOffer() {
|
void placeOffer() {
|
||||||
model.requestPlaceOfferErrorMessage.set(null);
|
model.requestPlaceOfferErrorMessage.set(null);
|
||||||
model.requestPlaceOfferSuccess.set(false);
|
model.requestPlaceOfferSuccess.set(false);
|
||||||
|
@ -196,10 +180,6 @@ class CreateOfferPM extends PresentationModel<CreateOfferModel> {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
///////////////////////////////////////////////////////////////////////////////////////////
|
|
||||||
// UI events
|
|
||||||
///////////////////////////////////////////////////////////////////////////////////////////
|
|
||||||
|
|
||||||
void onShowPayFundsScreen() {
|
void onShowPayFundsScreen() {
|
||||||
isPlaceOfferButtonVisible.set(true);
|
isPlaceOfferButtonVisible.set(true);
|
||||||
}
|
}
|
||||||
|
@ -294,10 +274,6 @@ class CreateOfferPM extends PresentationModel<CreateOfferModel> {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
///////////////////////////////////////////////////////////////////////////////////////////
|
|
||||||
// Getters
|
|
||||||
///////////////////////////////////////////////////////////////////////////////////////////
|
|
||||||
|
|
||||||
WalletService getWalletService() {
|
WalletService getWalletService() {
|
||||||
return model.getWalletService();
|
return model.getWalletService();
|
||||||
}
|
}
|
||||||
|
@ -310,10 +286,6 @@ class CreateOfferPM extends PresentationModel<CreateOfferModel> {
|
||||||
return model.displaySecurityDepositInfo();
|
return model.displaySecurityDepositInfo();
|
||||||
}
|
}
|
||||||
|
|
||||||
///////////////////////////////////////////////////////////////////////////////////////////
|
|
||||||
// Private
|
|
||||||
///////////////////////////////////////////////////////////////////////////////////////////
|
|
||||||
|
|
||||||
private void setupListeners() {
|
private void setupListeners() {
|
||||||
// Bidirectional bindings are used for all input fields: amount, price, volume and minAmount
|
// Bidirectional bindings are used for all input fields: amount, price, volume and minAmount
|
||||||
// We do volume/amount calculation during input, so user has immediate feedback
|
// We do volume/amount calculation during input, so user has immediate feedback
|
||||||
|
|
|
@ -77,10 +77,6 @@ class OfferBookModel extends UIModel {
|
||||||
private Direction direction;
|
private Direction direction;
|
||||||
|
|
||||||
|
|
||||||
///////////////////////////////////////////////////////////////////////////////////////////
|
|
||||||
// Constructor
|
|
||||||
///////////////////////////////////////////////////////////////////////////////////////////
|
|
||||||
|
|
||||||
@Inject
|
@Inject
|
||||||
OfferBookModel(User user,
|
OfferBookModel(User user,
|
||||||
TradeManager tradeManager,
|
TradeManager tradeManager,
|
||||||
|
@ -98,10 +94,6 @@ class OfferBookModel extends UIModel {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
///////////////////////////////////////////////////////////////////////////////////////////
|
|
||||||
// Lifecycle
|
|
||||||
///////////////////////////////////////////////////////////////////////////////////////////
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void initialize() {
|
public void initialize() {
|
||||||
bankAccountChangeListener = (observableValue, oldValue, newValue) -> setBankAccount(newValue);
|
bankAccountChangeListener = (observableValue, oldValue, newValue) -> setBankAccount(newValue);
|
||||||
|
@ -141,10 +133,6 @@ class OfferBookModel extends UIModel {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
///////////////////////////////////////////////////////////////////////////////////////////
|
|
||||||
// Public methods
|
|
||||||
///////////////////////////////////////////////////////////////////////////////////////////
|
|
||||||
|
|
||||||
void removeOffer(Offer offer) {
|
void removeOffer(Offer offer) {
|
||||||
tradeManager.removeOffer(offer);
|
tradeManager.removeOffer(offer);
|
||||||
}
|
}
|
||||||
|
@ -216,10 +204,6 @@ class OfferBookModel extends UIModel {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
///////////////////////////////////////////////////////////////////////////////////////////
|
|
||||||
// Setters
|
|
||||||
///////////////////////////////////////////////////////////////////////////////////////////
|
|
||||||
|
|
||||||
void setDirection(Direction direction) {
|
void setDirection(Direction direction) {
|
||||||
this.direction = direction;
|
this.direction = direction;
|
||||||
}
|
}
|
||||||
|
@ -240,10 +224,6 @@ class OfferBookModel extends UIModel {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
///////////////////////////////////////////////////////////////////////////////////////////
|
|
||||||
// Getters
|
|
||||||
///////////////////////////////////////////////////////////////////////////////////////////
|
|
||||||
|
|
||||||
SortedList<OfferBookListItem> getOfferList() {
|
SortedList<OfferBookListItem> getOfferList() {
|
||||||
return sortedItems;
|
return sortedItems;
|
||||||
}
|
}
|
||||||
|
@ -284,10 +264,6 @@ class OfferBookModel extends UIModel {
|
||||||
return direction;
|
return direction;
|
||||||
}
|
}
|
||||||
|
|
||||||
///////////////////////////////////////////////////////////////////////////////////////////
|
|
||||||
// Private methods
|
|
||||||
///////////////////////////////////////////////////////////////////////////////////////////
|
|
||||||
|
|
||||||
private void setBankAccount(BankAccount bankAccount) {
|
private void setBankAccount(BankAccount bankAccount) {
|
||||||
if (bankAccount != null) {
|
if (bankAccount != null) {
|
||||||
fiatCode.set(bankAccount.getCurrency().getCurrencyCode());
|
fiatCode.set(bankAccount.getCurrency().getCurrencyCode());
|
||||||
|
|
|
@ -53,10 +53,6 @@ class OfferBookPM extends PresentationModel<OfferBookModel> {
|
||||||
final StringProperty restrictionsInfo = new SimpleStringProperty();
|
final StringProperty restrictionsInfo = new SimpleStringProperty();
|
||||||
|
|
||||||
|
|
||||||
///////////////////////////////////////////////////////////////////////////////////////////
|
|
||||||
// Constructor
|
|
||||||
///////////////////////////////////////////////////////////////////////////////////////////
|
|
||||||
|
|
||||||
@Inject
|
@Inject
|
||||||
OfferBookPM(OfferBookModel model,
|
OfferBookPM(OfferBookModel model,
|
||||||
OptionalFiatValidator optionalFiatValidator,
|
OptionalFiatValidator optionalFiatValidator,
|
||||||
|
@ -70,10 +66,6 @@ class OfferBookPM extends PresentationModel<OfferBookModel> {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
///////////////////////////////////////////////////////////////////////////////////////////
|
|
||||||
// Lifecycle
|
|
||||||
///////////////////////////////////////////////////////////////////////////////////////////
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void initialize() {
|
public void initialize() {
|
||||||
super.initialize();
|
super.initialize();
|
||||||
|
@ -135,10 +127,6 @@ class OfferBookPM extends PresentationModel<OfferBookModel> {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
///////////////////////////////////////////////////////////////////////////////////////////
|
|
||||||
// Public methods
|
|
||||||
///////////////////////////////////////////////////////////////////////////////////////////
|
|
||||||
|
|
||||||
void removeOffer(Offer offer) {
|
void removeOffer(Offer offer) {
|
||||||
model.removeOffer(offer);
|
model.removeOffer(offer);
|
||||||
}
|
}
|
||||||
|
@ -148,19 +136,11 @@ class OfferBookPM extends PresentationModel<OfferBookModel> {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
///////////////////////////////////////////////////////////////////////////////////////////
|
|
||||||
// Setters
|
|
||||||
///////////////////////////////////////////////////////////////////////////////////////////
|
|
||||||
|
|
||||||
void setDirection(Direction direction) {
|
void setDirection(Direction direction) {
|
||||||
model.setDirection(direction);
|
model.setDirection(direction);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
///////////////////////////////////////////////////////////////////////////////////////////
|
|
||||||
// Getters
|
|
||||||
///////////////////////////////////////////////////////////////////////////////////////////
|
|
||||||
|
|
||||||
SortedList<OfferBookListItem> getOfferList() {
|
SortedList<OfferBookListItem> getOfferList() {
|
||||||
return model.getOfferList();
|
return model.getOfferList();
|
||||||
}
|
}
|
||||||
|
@ -207,10 +187,6 @@ class OfferBookPM extends PresentationModel<OfferBookModel> {
|
||||||
return model.getPriceAsFiat();
|
return model.getPriceAsFiat();
|
||||||
}
|
}
|
||||||
|
|
||||||
///////////////////////////////////////////////////////////////////////////////////////////
|
|
||||||
// Private methods
|
|
||||||
///////////////////////////////////////////////////////////////////////////////////////////
|
|
||||||
|
|
||||||
private InputValidator.ValidationResult isBtcInputValid(String input) {
|
private InputValidator.ValidationResult isBtcInputValid(String input) {
|
||||||
return optionalBtcValidator.validate(input);
|
return optionalBtcValidator.validate(input);
|
||||||
}
|
}
|
||||||
|
|
|
@ -78,10 +78,6 @@ class TakeOfferModel extends UIModel {
|
||||||
final ObjectProperty<Coin> networkFeeAsCoin = new SimpleObjectProperty<>();
|
final ObjectProperty<Coin> networkFeeAsCoin = new SimpleObjectProperty<>();
|
||||||
|
|
||||||
|
|
||||||
///////////////////////////////////////////////////////////////////////////////////////////
|
|
||||||
// Constructor
|
|
||||||
///////////////////////////////////////////////////////////////////////////////////////////
|
|
||||||
|
|
||||||
@Inject
|
@Inject
|
||||||
TakeOfferModel(TradeManager tradeManager, WalletService walletService,
|
TakeOfferModel(TradeManager tradeManager, WalletService walletService,
|
||||||
Preferences preferences, Persistence persistence) {
|
Preferences preferences, Persistence persistence) {
|
||||||
|
@ -92,10 +88,6 @@ class TakeOfferModel extends UIModel {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
///////////////////////////////////////////////////////////////////////////////////////////
|
|
||||||
// Lifecycle
|
|
||||||
///////////////////////////////////////////////////////////////////////////////////////////
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void initialize() {
|
public void initialize() {
|
||||||
super.initialize();
|
super.initialize();
|
||||||
|
@ -126,10 +118,6 @@ class TakeOfferModel extends UIModel {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
///////////////////////////////////////////////////////////////////////////////////////////
|
|
||||||
// Methods
|
|
||||||
///////////////////////////////////////////////////////////////////////////////////////////
|
|
||||||
|
|
||||||
void initWithData(Coin amount, Offer offer) {
|
void initWithData(Coin amount, Offer offer) {
|
||||||
this.offer = offer;
|
this.offer = offer;
|
||||||
|
|
||||||
|
@ -235,14 +223,6 @@ class TakeOfferModel extends UIModel {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
///////////////////////////////////////////////////////////////////////////////////////////
|
|
||||||
// Setter
|
|
||||||
///////////////////////////////////////////////////////////////////////////////////////////
|
|
||||||
|
|
||||||
|
|
||||||
///////////////////////////////////////////////////////////////////////////////////////////
|
|
||||||
// Getter
|
|
||||||
///////////////////////////////////////////////////////////////////////////////////////////
|
|
||||||
|
|
||||||
WalletService getWalletService() {
|
WalletService getWalletService() {
|
||||||
return walletService;
|
return walletService;
|
||||||
|
@ -253,10 +233,6 @@ class TakeOfferModel extends UIModel {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
///////////////////////////////////////////////////////////////////////////////////////////
|
|
||||||
// Private
|
|
||||||
///////////////////////////////////////////////////////////////////////////////////////////
|
|
||||||
|
|
||||||
private void updateBalance(@NotNull Coin balance) {
|
private void updateBalance(@NotNull Coin balance) {
|
||||||
isWalletFunded.set(totalToPayAsCoin.get() != null && balance.compareTo(totalToPayAsCoin.get()) >= 0);
|
isWalletFunded.set(totalToPayAsCoin.get() != null && balance.compareTo(totalToPayAsCoin.get()) >= 0);
|
||||||
}
|
}
|
||||||
|
|
|
@ -89,10 +89,6 @@ class TakeOfferPM extends PresentationModel<TakeOfferModel> {
|
||||||
final ObjectProperty<Coin> totalToPayAsCoin = new SimpleObjectProperty<>();
|
final ObjectProperty<Coin> totalToPayAsCoin = new SimpleObjectProperty<>();
|
||||||
|
|
||||||
|
|
||||||
///////////////////////////////////////////////////////////////////////////////////////////
|
|
||||||
// Constructor
|
|
||||||
///////////////////////////////////////////////////////////////////////////////////////////
|
|
||||||
|
|
||||||
// non private for testing
|
// non private for testing
|
||||||
@Inject
|
@Inject
|
||||||
TakeOfferPM(TakeOfferModel model, BtcValidator btcValidator, BSFormatter formatter) {
|
TakeOfferPM(TakeOfferModel model, BtcValidator btcValidator, BSFormatter formatter) {
|
||||||
|
@ -103,10 +99,6 @@ class TakeOfferPM extends PresentationModel<TakeOfferModel> {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
///////////////////////////////////////////////////////////////////////////////////////////
|
|
||||||
// Lifecycle
|
|
||||||
///////////////////////////////////////////////////////////////////////////////////////////
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void initialize() {
|
public void initialize() {
|
||||||
super.initialize();
|
super.initialize();
|
||||||
|
@ -138,10 +130,6 @@ class TakeOfferPM extends PresentationModel<TakeOfferModel> {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
///////////////////////////////////////////////////////////////////////////////////////////
|
|
||||||
// Setter
|
|
||||||
///////////////////////////////////////////////////////////////////////////////////////////
|
|
||||||
|
|
||||||
// setOfferBookFilter is a one time call
|
// setOfferBookFilter is a one time call
|
||||||
void initWithData(Direction direction, Coin amount, Offer offer) {
|
void initWithData(Direction direction, Coin amount, Offer offer) {
|
||||||
model.initWithData(amount, offer);
|
model.initWithData(amount, offer);
|
||||||
|
@ -178,10 +166,6 @@ class TakeOfferPM extends PresentationModel<TakeOfferModel> {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
///////////////////////////////////////////////////////////////////////////////////////////
|
|
||||||
// UI actions
|
|
||||||
///////////////////////////////////////////////////////////////////////////////////////////
|
|
||||||
|
|
||||||
void takeOffer() {
|
void takeOffer() {
|
||||||
model.requestTakeOfferErrorMessage.set(null);
|
model.requestTakeOfferErrorMessage.set(null);
|
||||||
model.requestTakeOfferSuccess.set(false);
|
model.requestTakeOfferSuccess.set(false);
|
||||||
|
@ -197,10 +181,6 @@ class TakeOfferPM extends PresentationModel<TakeOfferModel> {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
///////////////////////////////////////////////////////////////////////////////////////////
|
|
||||||
// UI events
|
|
||||||
///////////////////////////////////////////////////////////////////////////////////////////
|
|
||||||
|
|
||||||
void onShowPayFundsScreen() {
|
void onShowPayFundsScreen() {
|
||||||
isTakeOfferButtonVisible.set(true);
|
isTakeOfferButtonVisible.set(true);
|
||||||
}
|
}
|
||||||
|
@ -231,10 +211,6 @@ class TakeOfferPM extends PresentationModel<TakeOfferModel> {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
///////////////////////////////////////////////////////////////////////////////////////////
|
|
||||||
// Getters
|
|
||||||
///////////////////////////////////////////////////////////////////////////////////////////
|
|
||||||
|
|
||||||
WalletService getWalletService() {
|
WalletService getWalletService() {
|
||||||
return model.getWalletService();
|
return model.getWalletService();
|
||||||
}
|
}
|
||||||
|
@ -308,10 +284,6 @@ class TakeOfferPM extends PresentationModel<TakeOfferModel> {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
///////////////////////////////////////////////////////////////////////////////////////////
|
|
||||||
// Private
|
|
||||||
///////////////////////////////////////////////////////////////////////////////////////////
|
|
||||||
|
|
||||||
private void setupListeners() {
|
private void setupListeners() {
|
||||||
// Bidirectional bindings are used for all input fields: amount, price, volume and minAmount
|
// Bidirectional bindings are used for all input fields: amount, price, volume and minAmount
|
||||||
// We do volume/amount calculation during input, so user has immediate feedback
|
// We do volume/amount calculation during input, so user has immediate feedback
|
||||||
|
|
Loading…
Add table
Reference in a new issue