Increase padding for account limitation when adding a new payment account to not overlap validation errors

This commit is contained in:
Christoph Atteneder 2018-11-22 12:29:50 +01:00
parent 735ab3acda
commit a7a65052c5
No known key found for this signature in database
GPG Key ID: CD5DC1C529CDFD3B
25 changed files with 56 additions and 52 deletions

View File

@ -213,7 +213,7 @@ abstract class BankForm extends GeneralBankForm {
addCompactTopLabelTextField(gridPane, ++gridRow, BankUtil.getAccountTypeLabel(countryCode),
bankAccountPayload.getAccountType()).second.setMouseTransparent(false);
addLimitations();
addLimitations(true);
}
@Override
@ -275,7 +275,7 @@ abstract class BankForm extends GeneralBankForm {
}
});
addLimitations();
addLimitations(false);
addAccountNameTextFieldWithAutoFillToggleButton();
updateFromInputs();

View File

@ -70,7 +70,7 @@ public class CashAppForm extends PaymentMethodForm {
final TradeCurrency singleTradeCurrency = account.getSingleTradeCurrency();
final String nameAndCode = singleTradeCurrency != null ? singleTradeCurrency.getNameAndCode() : "";
FormBuilder.addTopLabelTextField(gridPane, ++gridRow, Res.get("shared.currency"), nameAndCode);
addLimitations();
addLimitations(false);
addAccountNameTextFieldWithAutoFillToggleButton();
}
@ -89,7 +89,7 @@ public class CashAppForm extends PaymentMethodForm {
final TradeCurrency singleTradeCurrency = account.getSingleTradeCurrency();
final String nameAndCode = singleTradeCurrency != null ? singleTradeCurrency.getNameAndCode() : "";
FormBuilder.addTopLabelTextField(gridPane, ++gridRow, Res.get("shared.currency"), nameAndCode);
addLimitations();
addLimitations(true);
}
@Override

View File

@ -243,7 +243,7 @@ public class CashDepositForm extends GeneralBankForm {
textArea.setText(requirements);
}
addLimitations();
addLimitations(true);
}
@Override
@ -310,7 +310,7 @@ public class CashDepositForm extends GeneralBankForm {
updateFromInputs();
});
addLimitations();
addLimitations(false);
addAccountNameTextFieldWithAutoFillToggleButton();
updateFromInputs();

View File

@ -81,7 +81,7 @@ public class ChaseQuickPayForm extends PaymentMethodForm {
TradeCurrency singleTradeCurrency = chaseQuickPayAccount.getSingleTradeCurrency();
String nameAndCode = singleTradeCurrency != null ? singleTradeCurrency.getNameAndCode() : "null";
addTopLabelTextField(gridPane, ++gridRow, Res.get("shared.currency"), nameAndCode);
addLimitations();
addLimitations(false);
addAccountNameTextFieldWithAutoFillToggleButton();
}
@ -105,7 +105,7 @@ public class ChaseQuickPayForm extends PaymentMethodForm {
TradeCurrency singleTradeCurrency = chaseQuickPayAccount.getSingleTradeCurrency();
String nameAndCode = singleTradeCurrency != null ? singleTradeCurrency.getNameAndCode() : "null";
addCompactTopLabelTextField(gridPane, ++gridRow, Res.get("shared.currency"), nameAndCode);
addLimitations();
addLimitations(true);
}
@Override

View File

@ -81,7 +81,7 @@ public class ClearXchangeForm extends PaymentMethodForm {
final String nameAndCode = singleTradeCurrency != null ? singleTradeCurrency.getNameAndCode() : "";
addTopLabelTextField(gridPane, ++gridRow, Res.get("shared.currency"),
nameAndCode);
addLimitations();
addLimitations(false);
addAccountNameTextFieldWithAutoFillToggleButton();
}
@ -106,7 +106,7 @@ public class ClearXchangeForm extends PaymentMethodForm {
final String nameAndCode = singleTradeCurrency != null ? singleTradeCurrency.getNameAndCode() : "";
addCompactTopLabelTextField(gridPane, ++gridRow, Res.get("shared.currency"),
nameAndCode);
addLimitations();
addLimitations(true);
}
@Override

View File

@ -99,7 +99,7 @@ public class CryptoCurrencyForm extends PaymentMethodForm {
updateFromInputs();
});
addLimitations();
addLimitations(false);
addAccountNameTextFieldWithAutoFillToggleButton();
}
@ -138,7 +138,7 @@ public class CryptoCurrencyForm extends PaymentMethodForm {
final String nameAndCode = singleTradeCurrency != null ? singleTradeCurrency.getNameAndCode() : "";
addCompactTopLabelTextField(gridPane, ++gridRow, Res.get("payment.altcoin"),
nameAndCode);
addLimitations();
addLimitations(true);
}
@Override

View File

@ -118,7 +118,7 @@ public class F2FForm extends PaymentMethodForm {
updateFromInputs();
});
addLimitations();
addLimitations(false);
addAccountNameTextFieldWithAutoFillToggleButton();
}
@ -168,7 +168,7 @@ public class F2FForm extends PaymentMethodForm {
textArea.setPrefHeight(60);
textArea.setEditable(false);
addLimitations();
addLimitations(true);
}
@Override

View File

@ -86,7 +86,7 @@ public class FasterPaymentsForm extends PaymentMethodForm {
String nameAndCode = singleTradeCurrency != null ? singleTradeCurrency.getNameAndCode() : "";
addTopLabelTextField(gridPane, ++gridRow, Res.get("shared.currency"),
nameAndCode);
addLimitations();
addLimitations(false);
addAccountNameTextFieldWithAutoFillToggleButton();
}
@ -110,7 +110,7 @@ public class FasterPaymentsForm extends PaymentMethodForm {
TradeCurrency singleTradeCurrency = fasterPaymentsAccount.getSingleTradeCurrency();
String nameAndCode = singleTradeCurrency != null ? singleTradeCurrency.getNameAndCode() : "";
addCompactTopLabelTextField(gridPane, ++gridRow, Res.get("shared.currency"), nameAndCode);
addLimitations();
addLimitations(true);
}
@Override

View File

@ -39,7 +39,7 @@ abstract public class GeneralAccountNumberForm extends PaymentMethodForm {
addTradeCurrency();
addLimitations();
addLimitations(false);
addAccountNameTextFieldWithAutoFillToggleButton();
}
@ -83,6 +83,6 @@ abstract public class GeneralAccountNumberForm extends PaymentMethodForm {
final String nameAndCode = singleTradeCurrency != null ? singleTradeCurrency.getNameAndCode() : "";
addCompactTopLabelTextField(gridPane, ++gridRow, Res.get("shared.currency"), nameAndCode);
addLimitations();
addLimitations(true);
}
}

View File

@ -72,7 +72,7 @@ public class HalCashForm extends PaymentMethodForm {
TradeCurrency singleTradeCurrency = halCashAccount.getSingleTradeCurrency();
String nameAndCode = singleTradeCurrency != null ? singleTradeCurrency.getNameAndCode() : "null";
addTopLabelTextField(gridPane, ++gridRow, Res.get("shared.currency"), nameAndCode);
addLimitations();
addLimitations(false);
addAccountNameTextFieldWithAutoFillToggleButton();
}
@ -94,7 +94,7 @@ public class HalCashForm extends PaymentMethodForm {
TradeCurrency singleTradeCurrency = halCashAccount.getSingleTradeCurrency();
String nameAndCode = singleTradeCurrency != null ? singleTradeCurrency.getNameAndCode() : "null";
addCompactTopLabelTextField(gridPane, ++gridRow, Res.get("shared.currency"), nameAndCode);
addLimitations();
addLimitations(true);
}
@Override

View File

@ -99,7 +99,7 @@ public class InteracETransferForm extends PaymentMethodForm {
String nameAndCode = singleTradeCurrency != null ? singleTradeCurrency.getNameAndCode() : "null";
addTopLabelTextField(gridPane, ++gridRow, Res.get("shared.currency"),
nameAndCode);
addLimitations();
addLimitations(false);
addAccountNameTextFieldWithAutoFillToggleButton();
}
@ -127,7 +127,7 @@ public class InteracETransferForm extends PaymentMethodForm {
String nameAndCode = singleTradeCurrency != null ? singleTradeCurrency.getNameAndCode() : "null";
addCompactTopLabelTextField(gridPane, ++gridRow, Res.get("shared.currency"),
nameAndCode);
addLimitations();
addLimitations(true);
}
@Override

View File

@ -69,7 +69,7 @@ public class MoneyBeamForm extends PaymentMethodForm {
final TradeCurrency singleTradeCurrency = account.getSingleTradeCurrency();
final String nameAndCode = singleTradeCurrency != null ? singleTradeCurrency.getNameAndCode() : "";
addTopLabelTextField(gridPane, ++gridRow, Res.get("shared.currency"), nameAndCode);
addLimitations();
addLimitations(false);
addAccountNameTextFieldWithAutoFillToggleButton();
}
@ -88,7 +88,7 @@ public class MoneyBeamForm extends PaymentMethodForm {
final TradeCurrency singleTradeCurrency = account.getSingleTradeCurrency();
final String nameAndCode = singleTradeCurrency != null ? singleTradeCurrency.getNameAndCode() : "";
addCompactTopLabelTextField(gridPane, ++gridRow, Res.get("shared.currency"), nameAndCode);
addLimitations();
addLimitations(true);
}
@Override

View File

@ -96,7 +96,7 @@ public class MoneyGramForm extends PaymentMethodForm {
moneyGramAccountPayload.getState()).second.setMouseTransparent(false);
addCompactTopLabelTextField(gridPane, ++gridRow, Res.get("payment.email"),
moneyGramAccountPayload.getEmail());
addLimitations();
addLimitations(true);
addCurrenciesGrid(false);
}
@ -130,7 +130,7 @@ public class MoneyGramForm extends PaymentMethodForm {
emailInputTextField.setValidator(emailValidator);
addCurrenciesGrid(true);
addLimitations();
addLimitations(false);
addAccountNameTextFieldWithAutoFillToggleButton();
updateFromInputs();

View File

@ -83,7 +83,7 @@ public class OKPayForm extends PaymentMethodForm {
});
addCurrenciesGrid(true);
addLimitations();
addLimitations(false);
addAccountNameTextFieldWithAutoFillToggleButton();
}
@ -128,7 +128,7 @@ public class OKPayForm extends PaymentMethodForm {
TextField field = FormBuilder.addTopLabelTextField(gridPane, ++gridRow, Res.get("payment.wallet"),
okPayAccount.getAccountNr()).second;
field.setMouseTransparent(false);
addLimitations();
addLimitations(true);
addCurrenciesGrid(false);
}

View File

@ -76,8 +76,8 @@ public abstract class PaymentMethodForm {
protected final BooleanProperty allInputsValid = new SimpleBooleanProperty();
protected int gridRowFrom;
protected InputTextField accountNameTextField;
protected ToggleButton useCustomAccountNameToggleButton;
InputTextField accountNameTextField;
ToggleButton useCustomAccountNameToggleButton;
protected ComboBox<TradeCurrency> currencyComboBox;
public PaymentMethodForm(PaymentAccount paymentAccount, AccountAgeWitnessService accountAgeWitnessService,
@ -155,7 +155,7 @@ public abstract class PaymentMethodForm {
return time;
}
protected void addLimitations() {
protected void addLimitations(boolean isDisplayForm) {
long hours = paymentAccount.getPaymentMethod().getMaxTradePeriod() / 3600_000;
final TradeCurrency tradeCurrency;
@ -183,7 +183,11 @@ public abstract class PaymentMethodForm {
getTimeText(hours),
formatter.formatCoinWithCode(Coin.valueOf(accountAgeWitnessService.getMyTradeLimit(paymentAccount, tradeCurrency.getCode()))),
formatter.formatAccountAge(accountAge));
addCompactTopLabelTextField(gridPane, ++gridRow, Res.get("payment.limitations"), limitationsText);
if (isDisplayForm)
addCompactTopLabelTextField(gridPane, ++gridRow, Res.get("payment.limitations"), limitationsText);
else
addTopLabelTextField(gridPane, ++gridRow, Res.get("payment.limitations"), limitationsText);
if (isAddAccountScreen) {
InputTextField inputTextField = addInputTextField(gridPane, ++gridRow, Res.get("payment.salt"), 0);

View File

@ -79,7 +79,7 @@ public class PopmoneyForm extends PaymentMethodForm {
final TradeCurrency singleTradeCurrency = account.getSingleTradeCurrency();
final String nameAndCode = singleTradeCurrency != null ? singleTradeCurrency.getNameAndCode() : "";
addTopLabelTextField(gridPane, ++gridRow, Res.get("shared.currency"), nameAndCode);
addLimitations();
addLimitations(false);
addAccountNameTextFieldWithAutoFillToggleButton();
}
@ -100,7 +100,7 @@ public class PopmoneyForm extends PaymentMethodForm {
final TradeCurrency singleTradeCurrency = account.getSingleTradeCurrency();
final String nameAndCode = singleTradeCurrency != null ? singleTradeCurrency.getNameAndCode() : "";
addCompactTopLabelTextField(gridPane, ++gridRow, Res.get("shared.currency"), nameAndCode);
addLimitations();
addLimitations(true);
}
@Override

View File

@ -72,7 +72,7 @@ public class PromptPayForm extends PaymentMethodForm {
TradeCurrency singleTradeCurrency = promptPayAccount.getSingleTradeCurrency();
String nameAndCode = singleTradeCurrency != null ? singleTradeCurrency.getNameAndCode() : "null";
addTopLabelTextField(gridPane, ++gridRow, Res.get("shared.currency"), nameAndCode);
addLimitations();
addLimitations(false);
addAccountNameTextFieldWithAutoFillToggleButton();
}
@ -94,7 +94,7 @@ public class PromptPayForm extends PaymentMethodForm {
TradeCurrency singleTradeCurrency = promptPayAccount.getSingleTradeCurrency();
String nameAndCode = singleTradeCurrency != null ? singleTradeCurrency.getNameAndCode() : "null";
addCompactTopLabelTextField(gridPane, ++gridRow, Res.get("shared.currency"), nameAndCode);
addLimitations();
addLimitations(true);
}
@Override

View File

@ -73,7 +73,7 @@ public class RevolutForm extends PaymentMethodForm {
});
addCurrenciesGrid(true);
addLimitations();
addLimitations(false);
addAccountNameTextFieldWithAutoFillToggleButton();
}
@ -105,7 +105,7 @@ public class RevolutForm extends PaymentMethodForm {
TextField field = addCompactTopLabelTextField(gridPane, ++gridRow, Res.get("payment.revolut.accountId"),
account.getAccountId()).second;
field.setMouseTransparent(false);
addLimitations();
addLimitations(true);
addCurrenciesGrid(false);
}

View File

@ -115,7 +115,7 @@ public class SepaForm extends GeneralSepaForm {
addEuroCountriesGrid();
addNonEuroCountriesGrid();
addLimitations();
addLimitations(false);
addAccountNameTextFieldWithAutoFillToggleButton();
countryComboBox.setItems(FXCollections.observableArrayList(CountryUtil.getAllSepaCountries()));
@ -207,7 +207,7 @@ public class SepaForm extends GeneralSepaForm {
acceptedCountries.setMouseTransparent(false);
acceptedCountries.setTooltip(tooltip);
}
addLimitations();
addLimitations(true);
}
@Override

View File

@ -115,7 +115,7 @@ public class SepaInstantForm extends GeneralSepaForm {
addEuroCountriesGrid();
addNonEuroCountriesGrid();
addLimitations();
addLimitations(false);
addAccountNameTextFieldWithAutoFillToggleButton();
countryComboBox.setItems(FXCollections.observableArrayList(CountryUtil.getAllSepaInstantCountries()));
@ -206,7 +206,7 @@ public class SepaInstantForm extends GeneralSepaForm {
acceptedCountries.setMouseTransparent(false);
acceptedCountries.setTooltip(tooltip);
}
addLimitations();
addLimitations(true);
}
@Override

View File

@ -87,7 +87,7 @@ public class SwishForm extends PaymentMethodForm {
TradeCurrency singleTradeCurrency = swishAccount.getSingleTradeCurrency();
String nameAndCode = singleTradeCurrency != null ? singleTradeCurrency.getNameAndCode() : "null";
addTopLabelTextField(gridPane, ++gridRow, Res.get("shared.currency"), nameAndCode);
addLimitations();
addLimitations(false);
addAccountNameTextFieldWithAutoFillToggleButton();
}
@ -111,7 +111,7 @@ public class SwishForm extends PaymentMethodForm {
TradeCurrency singleTradeCurrency = swishAccount.getSingleTradeCurrency();
String nameAndCode = singleTradeCurrency != null ? singleTradeCurrency.getNameAndCode() : "null";
addCompactTopLabelTextField(gridPane, ++gridRow, Res.get("shared.currency"), nameAndCode);
addLimitations();
addLimitations(true);
}
@Override

View File

@ -88,7 +88,7 @@ public class USPostalMoneyOrderForm extends PaymentMethodForm {
String nameAndCode = singleTradeCurrency != null ? singleTradeCurrency.getNameAndCode() : "null";
addTopLabelTextField(gridPane, ++gridRow, Res.get("shared.currency"),
nameAndCode);
addLimitations();
addLimitations(false);
addAccountNameTextFieldWithAutoFillToggleButton();
}
@ -113,7 +113,7 @@ public class USPostalMoneyOrderForm extends PaymentMethodForm {
TradeCurrency singleTradeCurrency = usPostalMoneyOrderAccount.getSingleTradeCurrency();
String nameAndCode = singleTradeCurrency != null ? singleTradeCurrency.getNameAndCode() : "null";
addCompactTopLabelTextField(gridPane, ++gridRow, Res.get("shared.currency"), nameAndCode);
addLimitations();
addLimitations(true);
}
@Override

View File

@ -72,7 +72,7 @@ public class UpholdForm extends PaymentMethodForm {
});
addCurrenciesGrid(true);
addLimitations();
addLimitations(false);
addAccountNameTextFieldWithAutoFillToggleButton();
}
@ -105,7 +105,7 @@ public class UpholdForm extends PaymentMethodForm {
TextField field = addCompactTopLabelTextField(gridPane, ++gridRow, Res.get("payment.uphold.accountId"),
upholdAccount.getAccountId()).second;
field.setMouseTransparent(false);
addLimitations();
addLimitations(true);
addCurrenciesGrid(false);
}

View File

@ -83,7 +83,7 @@ public class VenmoForm extends PaymentMethodForm {
final TradeCurrency singleTradeCurrency = account.getSingleTradeCurrency();
final String nameAndCode = singleTradeCurrency != null ? singleTradeCurrency.getNameAndCode() : "";
addTopLabelTextField(gridPane, ++gridRow, Res.get("shared.currency"), nameAndCode);
addLimitations();
addLimitations(false);
addAccountNameTextFieldWithAutoFillToggleButton();
}
@ -109,7 +109,7 @@ public class VenmoForm extends PaymentMethodForm {
final TradeCurrency singleTradeCurrency = account.getSingleTradeCurrency();
final String nameAndCode = singleTradeCurrency != null ? singleTradeCurrency.getNameAndCode() : "";
addCompactTopLabelTextField(gridPane, ++gridRow, Res.get("shared.currency"), nameAndCode);
addLimitations();
addLimitations(true);
}
@Override

View File

@ -105,7 +105,7 @@ public class WesternUnionForm extends PaymentMethodForm {
westernUnionAccountPayload.getState()).second.setMouseTransparent(false);
addCompactTopLabelTextField(gridPane, ++gridRow, Res.get("payment.email"),
westernUnionAccountPayload.getEmail());
addLimitations();
addLimitations(true);
}
private void onTradeCurrencySelected(TradeCurrency tradeCurrency) {
@ -167,7 +167,7 @@ public class WesternUnionForm extends PaymentMethodForm {
});
emailInputTextField.setValidator(emailValidator);
addLimitations();
addLimitations(false);
addAccountNameTextFieldWithAutoFillToggleButton();
updateFromInputs();