Show error text without truncation

This commit is contained in:
Christoph Atteneder 2018-11-14 17:07:17 +01:00
parent 491d3b0e5b
commit dc69cac87e
No known key found for this signature in database
GPG key ID: CD5DC1C529CDFD3B
3 changed files with 24 additions and 36 deletions

View file

@ -2517,8 +2517,8 @@ validation.accountNrChars=Account number must consist of {0} characters.
validation.btc.invalidAddress=The address is not correct. Please check the address format.
validation.integerOnly=Please enter integer numbers only.
validation.inputError=Your input caused an error:\n{0}
validation.bsq.insufficientBalance=Amount exceeds the available balance of {0}.
validation.btc.exceedsMaxTradeLimit=Amount larger than your trade limit of {0} is not allowed.
validation.bsq.insufficientBalance=Your available balance is {0}.
validation.btc.exceedsMaxTradeLimit=Your trade limit is {0}.
validation.bsq.amountBelowMinAmount=Min. amount is {0}
validation.nationalAccountId={0} must consist of {1} numbers.

View file

@ -428,7 +428,7 @@ bg color of non edit textFields: fafafa
-fx-border-color: -bs-rd-grey-background-dark;
-fx-border-radius: 3;
-fx-pref-height: 43;
-fx-pref-width: 300;
-fx-pref-width: 310;
-fx-effect: innershadow(gaussian, -bs-rd-black-transparent, 3, 0, 0, 1);
}

View file

@ -132,6 +132,7 @@ public abstract class MutableOfferView<M extends MutableOfferViewModel> extends
private ScrollPane scrollPane;
protected GridPane gridPane;
private TitledGroupBg payFundsTitledGroupBg, setDepositTitledGroupBg, paymentTitledGroupBg;
protected TitledGroupBg amountTitledGroupBg;
private BusyAnimation waitingForFundsSpinner;
private AutoTooltipButton nextButton, cancelButton1, cancelButton2, placeOfferButton;
private Button priceTypeToggleButton;
@ -141,18 +142,22 @@ public abstract class MutableOfferView<M extends MutableOfferViewModel> extends
private AddressTextField addressTextField;
private BalanceTextField balanceTextField;
private FundsTextField totalToPayTextField;
private Label amountDescriptionLabel,
priceCurrencyLabel, priceDescriptionLabel,
volumeDescriptionLabel,
waitingForFundsLabel, marketBasedPriceLabel, percentagePriceDescription,
buyerSecurityDepositBtcLabel, tradeFeeDescriptionLabel, resultLabel,
tradeFeeInBtcLabel, tradeFeeInBsqLabel;
private Label amountDescriptionLabel;
private Label priceCurrencyLabel;
private Label priceDescriptionLabel;
private Label volumeDescriptionLabel;
private Label waitingForFundsLabel;
private Label marketBasedPriceLabel;
private Label percentagePriceDescription;
private Label tradeFeeDescriptionLabel;
private Label resultLabel;
private Label tradeFeeInBtcLabel;
private Label tradeFeeInBsqLabel;
protected Label amountBtcLabel, volumeCurrencyLabel, minAmountBtcLabel;
private ComboBox<PaymentAccount> paymentAccountsComboBox;
private ComboBox<TradeCurrency> currencyComboBox;
private VBox currencySelection;
private ImageView qrCodeImageView;
private VBox fixedPriceBox, percentagePriceBox,
private VBox currencySelection, fixedPriceBox, percentagePriceBox,
currencyTextFieldBox;
private HBox fundingHBox, firstRowHBox, secondRowHBox, placeOfferBox, amountValueCurrencyBox,
priceAsPercentageValueCurrencyBox, volumeValueCurrencyBox, priceValueCurrencyBox,
@ -161,7 +166,8 @@ public abstract class MutableOfferView<M extends MutableOfferViewModel> extends
private Subscription isWaitingForFundsSubscription, balanceSubscription, cancelButton2StyleSubscription;
private ChangeListener<Boolean> amountFocusedListener, minAmountFocusedListener, volumeFocusedListener,
buyerSecurityDepositFocusedListener, priceFocusedListener, placeOfferCompletedListener,
priceAsPercentageFocusedListener;
priceAsPercentageFocusedListener, getShowWalletFundedNotificationListener,
tradeFeeInBtcToggleListener, tradeFeeInBsqToggleListener, tradeFeeVisibleListener;
private ChangeListener<String> tradeCurrencyCodeListener, errorMessageListener,
marketPriceMarginListener, volumeListener;
private ChangeListener<Number> marketPriceAvailableListener;
@ -171,12 +177,8 @@ public abstract class MutableOfferView<M extends MutableOfferViewModel> extends
protected int gridRow = 0;
private final List<Node> editOfferElements = new ArrayList<>();
private boolean clearXchangeWarningDisplayed, isActivated;
private ChangeListener<Boolean> getShowWalletFundedNotificationListener;
private InfoInputTextField marketBasedPriceInfoInputTextField, volumeInfoInputTextField;
protected TitledGroupBg amountTitledGroupBg;
private AutoTooltipSlideToggleButton tradeFeeInBtcToggle, tradeFeeInBsqToggle;
private ChangeListener<Boolean> tradeFeeInBtcToggleListener, tradeFeeInBsqToggleListener,
tradeFeeVisibleListener;
private Text xIcon, fakeXIcon;
///////////////////////////////////////////////////////////////////////////////////////////
@ -479,6 +481,8 @@ public abstract class MutableOfferView<M extends MutableOfferViewModel> extends
}
private void updateOfferElementsStyle() {
GridPane.setColumnSpan(firstRowHBox, 1);
final String activeInputStyle = "input-with-border";
final String readOnlyInputStyle = "input-with-border-readonly";
amountValueCurrencyBox.getStyleClass().remove(activeInputStyle);
@ -511,8 +515,6 @@ public abstract class MutableOfferView<M extends MutableOfferViewModel> extends
// unwanted selection events (item 0)
currencyComboBox.setOnAction(null);
resetValidationOfInputFields();
PaymentAccount paymentAccount = paymentAccountsComboBox.getSelectionModel().getSelectedItem();
if (paymentAccount != null) {
maybeShowClearXchangeWarning(paymentAccount);
@ -551,19 +553,6 @@ public abstract class MutableOfferView<M extends MutableOfferViewModel> extends
updatePriceToggle();
}
private void resetValidationOfInputFields() {
amountTextField.resetValidation();
amountTextField.validate();
minAmountTextField.resetValidation();
minAmountTextField.validate();
volumeTextField.resetValidation();
volumeTextField.validate();
fixedPriceTextField.resetValidation();
fixedPriceTextField.validate();
marketBasedPriceTextField.resetValidation();
marketBasedPriceTextField.validate();
}
private void onCurrencyComboBoxSelected() {
model.onCurrencySelected(currencyComboBox.getSelectionModel().getSelectedItem());
}
@ -970,9 +959,7 @@ public abstract class MutableOfferView<M extends MutableOfferViewModel> extends
columnConstraints1.setMinWidth(200);
ColumnConstraints columnConstraints2 = new ColumnConstraints();
columnConstraints2.setHgrow(Priority.ALWAYS);
ColumnConstraints columnConstraints3 = new ColumnConstraints();
columnConstraints3.setHgrow(Priority.NEVER);
gridPane.getColumnConstraints().addAll(columnConstraints1, columnConstraints2, columnConstraints3);
gridPane.getColumnConstraints().addAll(columnConstraints1, columnConstraints2);
scrollPane.setContent(gridPane);
}
@ -1127,10 +1114,10 @@ public abstract class MutableOfferView<M extends MutableOfferViewModel> extends
Tuple3<HBox, InputTextField, Label> tuple = getEditableValueBox(
Res.get("createOffer.securityDeposit.prompt"));
buyerSecurityDepositInputTextField = tuple.second;
buyerSecurityDepositBtcLabel = tuple.third;
Label buyerSecurityDepositBtcLabel = tuple.third;
VBox depositBox = getTradeInputBox(tuple.first, Res.get("createOffer.setDeposit")).second;
depositBox.setMaxWidth(300);
depositBox.setMaxWidth(310);
editOfferElements.add(buyerSecurityDepositInputTextField);
editOfferElements.add(buyerSecurityDepositBtcLabel);
@ -1321,6 +1308,7 @@ public abstract class MutableOfferView<M extends MutableOfferViewModel> extends
firstRowHBox.setSpacing(5);
firstRowHBox.setAlignment(Pos.CENTER_LEFT);
firstRowHBox.getChildren().addAll(amountBox, xLabel, percentagePriceBox, resultLabel, volumeBox);
GridPane.setColumnSpan(firstRowHBox, 2);
GridPane.setRowIndex(firstRowHBox, gridRow);
GridPane.setMargin(firstRowHBox, new Insets(Layout.COMPACT_FIRST_ROW_AND_GROUP_DISTANCE, 10, 0, 0));
gridPane.getChildren().add(firstRowHBox);