Search in sources :

Example 36 with TextField

use of javafx.scene.control.TextField in project bisq-desktop by bisq-network.

the class RevolutForm method addFormForDisplayAccount.

@Override
public void addFormForDisplayAccount() {
    gridRowFrom = gridRow;
    addLabelTextField(gridPane, gridRow, Res.get("payment.account.name"), account.getAccountName(), Layout.FIRST_ROW_AND_GROUP_DISTANCE);
    addLabelTextField(gridPane, ++gridRow, Res.getWithCol("shared.paymentMethod"), Res.get(account.getPaymentMethod().getId()));
    TextField field = addLabelTextField(gridPane, ++gridRow, Res.get("payment.revolut.accountId"), account.getAccountId()).second;
    field.setMouseTransparent(false);
    addLimitations();
    addCurrenciesGrid(false);
}
Also used : FormBuilder.addLabelInputTextField(bisq.desktop.util.FormBuilder.addLabelInputTextField) FormBuilder.addLabelTextField(bisq.desktop.util.FormBuilder.addLabelTextField) InputTextField(bisq.desktop.components.InputTextField) TextField(javafx.scene.control.TextField)

Example 37 with TextField

use of javafx.scene.control.TextField in project bisq-desktop by bisq-network.

the class SepaForm method addFormForDisplayAccount.

@Override
public void addFormForDisplayAccount() {
    gridRowFrom = gridRow;
    FormBuilder.addLabelTextField(gridPane, gridRow, Res.get("payment.account.name"), sepaAccount.getAccountName(), Layout.FIRST_ROW_AND_GROUP_DISTANCE);
    FormBuilder.addLabelTextField(gridPane, ++gridRow, Res.getWithCol("shared.paymentMethod"), Res.get(sepaAccount.getPaymentMethod().getId()));
    FormBuilder.addLabelTextField(gridPane, ++gridRow, Res.getWithCol("payment.account.owner"), sepaAccount.getHolderName());
    FormBuilder.addLabelTextField(gridPane, ++gridRow, "IBAN:", sepaAccount.getIban()).second.setMouseTransparent(false);
    FormBuilder.addLabelTextField(gridPane, ++gridRow, "BIC:", sepaAccount.getBic()).second.setMouseTransparent(false);
    FormBuilder.addLabelTextField(gridPane, ++gridRow, Res.get("payment.bank.country"), sepaAccount.getCountry() != null ? sepaAccount.getCountry().name : "");
    TradeCurrency singleTradeCurrency = sepaAccount.getSingleTradeCurrency();
    String nameAndCode = singleTradeCurrency != null ? singleTradeCurrency.getNameAndCode() : "null";
    FormBuilder.addLabelTextField(gridPane, ++gridRow, Res.getWithCol("shared.currency"), nameAndCode);
    String countries;
    Tooltip tooltip = null;
    if (CountryUtil.containsAllSepaEuroCountries(sepaAccount.getAcceptedCountryCodes())) {
        countries = Res.getWithCol("shared.allEuroCountries");
    } else {
        countries = CountryUtil.getCodesString(sepaAccount.getAcceptedCountryCodes());
        tooltip = new Tooltip(CountryUtil.getNamesByCodesString(sepaAccount.getAcceptedCountryCodes()));
    }
    TextField acceptedCountries = FormBuilder.addLabelTextField(gridPane, ++gridRow, Res.get("payment.accepted.countries"), countries).second;
    if (tooltip != null) {
        acceptedCountries.setMouseTransparent(false);
        acceptedCountries.setTooltip(tooltip);
    }
    addLimitations();
}
Also used : TradeCurrency(bisq.core.locale.TradeCurrency) Tooltip(javafx.scene.control.Tooltip) InputTextField(bisq.desktop.components.InputTextField) TextField(javafx.scene.control.TextField)

Example 38 with TextField

use of javafx.scene.control.TextField in project bisq-desktop by bisq-network.

the class SepaInstantForm method addFormForAddAccount.

@Override
public void addFormForAddAccount() {
    gridRowFrom = gridRow + 1;
    InputTextField holderNameInputTextField = FormBuilder.addLabelInputTextField(gridPane, ++gridRow, Res.getWithCol("payment.account.owner")).second;
    holderNameInputTextField.setValidator(inputValidator);
    holderNameInputTextField.textProperty().addListener((ov, oldValue, newValue) -> {
        sepaInstantAccount.setHolderName(newValue);
        updateFromInputs();
    });
    ibanInputTextField = FormBuilder.addLabelInputTextField(gridPane, ++gridRow, "IBAN:").second;
    ibanInputTextField.setValidator(ibanValidator);
    ibanInputTextField.textProperty().addListener((ov, oldValue, newValue) -> {
        sepaInstantAccount.setIban(newValue);
        updateFromInputs();
    });
    InputTextField bicInputTextField = FormBuilder.addLabelInputTextField(gridPane, ++gridRow, "BIC:").second;
    bicInputTextField.setValidator(bicValidator);
    bicInputTextField.textProperty().addListener((ov, oldValue, newValue) -> {
        sepaInstantAccount.setBic(newValue);
        updateFromInputs();
    });
    FormBuilder.addLabel(gridPane, ++gridRow, Res.getWithCol("payment.bank.country"));
    HBox hBox = new HBox();
    hBox.setSpacing(10);
    ComboBox<Country> countryComboBox = new ComboBox<>();
    currencyComboBox = new ComboBox<>();
    currencyTextField = new TextField("");
    currencyTextField.setEditable(false);
    currencyTextField.setMouseTransparent(true);
    currencyTextField.setFocusTraversable(false);
    currencyTextField.setMinWidth(300);
    currencyTextField.setVisible(false);
    currencyTextField.setManaged(false);
    currencyComboBox.setVisible(false);
    currencyComboBox.setManaged(false);
    hBox.getChildren().addAll(countryComboBox, currencyTextField, currencyComboBox);
    GridPane.setRowIndex(hBox, gridRow);
    GridPane.setColumnIndex(hBox, 1);
    gridPane.getChildren().add(hBox);
    countryComboBox.setPromptText(Res.get("payment.select.bank.country"));
    countryComboBox.setConverter(new StringConverter<Country>() {

        @Override
        public String toString(Country country) {
            return country.name + " (" + country.code + ")";
        }

        @Override
        public Country fromString(String s) {
            return null;
        }
    });
    countryComboBox.setOnAction(e -> {
        Country selectedItem = countryComboBox.getSelectionModel().getSelectedItem();
        sepaInstantAccount.setCountry(selectedItem);
        TradeCurrency currency = CurrencyUtil.getCurrencyByCountryCode(selectedItem.code);
        setupCurrency(selectedItem, currency);
        updateCountriesSelection(true, euroCountryCheckBoxes);
        updateCountriesSelection(true, nonEuroCountryCheckBoxes);
        updateFromInputs();
    });
    addEuroCountriesGrid(true);
    addNonEuroCountriesGrid(true);
    addLimitations();
    addAccountNameTextFieldWithAutoFillCheckBox();
    countryComboBox.setItems(FXCollections.observableArrayList(CountryUtil.getAllSepaInstantCountries()));
    Country country = CountryUtil.getDefaultCountry();
    if (CountryUtil.getAllSepaInstantCountries().contains(country)) {
        countryComboBox.getSelectionModel().select(country);
        sepaInstantAccount.setCountry(country);
        TradeCurrency currency = CurrencyUtil.getCurrencyByCountryCode(country.code);
        setupCurrency(country, currency);
    }
    updateFromInputs();
}
Also used : HBox(javafx.scene.layout.HBox) TradeCurrency(bisq.core.locale.TradeCurrency) InputTextField(bisq.desktop.components.InputTextField) ComboBox(javafx.scene.control.ComboBox) Country(bisq.core.locale.Country) InputTextField(bisq.desktop.components.InputTextField) TextField(javafx.scene.control.TextField)

Example 39 with TextField

use of javafx.scene.control.TextField in project bisq-desktop by bisq-network.

the class SepaInstantForm method addFormForDisplayAccount.

@Override
public void addFormForDisplayAccount() {
    gridRowFrom = gridRow;
    FormBuilder.addLabelTextField(gridPane, gridRow, Res.get("payment.account.name"), sepaInstantAccount.getAccountName(), Layout.FIRST_ROW_AND_GROUP_DISTANCE);
    FormBuilder.addLabelTextField(gridPane, ++gridRow, Res.getWithCol("shared.paymentMethod"), Res.get(sepaInstantAccount.getPaymentMethod().getId()));
    FormBuilder.addLabelTextField(gridPane, ++gridRow, Res.getWithCol("payment.account.owner"), sepaInstantAccount.getHolderName());
    FormBuilder.addLabelTextField(gridPane, ++gridRow, "IBAN:", sepaInstantAccount.getIban()).second.setMouseTransparent(false);
    FormBuilder.addLabelTextField(gridPane, ++gridRow, "BIC:", sepaInstantAccount.getBic()).second.setMouseTransparent(false);
    FormBuilder.addLabelTextField(gridPane, ++gridRow, Res.get("payment.bank.country"), sepaInstantAccount.getCountry() != null ? sepaInstantAccount.getCountry().name : "");
    TradeCurrency singleTradeCurrency = sepaInstantAccount.getSingleTradeCurrency();
    String nameAndCode = singleTradeCurrency != null ? singleTradeCurrency.getNameAndCode() : "null";
    FormBuilder.addLabelTextField(gridPane, ++gridRow, Res.getWithCol("shared.currency"), nameAndCode);
    String countries;
    Tooltip tooltip = null;
    if (CountryUtil.containsAllSepaInstantEuroCountries(sepaInstantAccount.getAcceptedCountryCodes())) {
        countries = Res.getWithCol("shared.allEuroCountries");
    } else {
        countries = CountryUtil.getCodesString(sepaInstantAccount.getAcceptedCountryCodes());
        tooltip = new Tooltip(CountryUtil.getNamesByCodesString(sepaInstantAccount.getAcceptedCountryCodes()));
    }
    TextField acceptedCountries = FormBuilder.addLabelTextField(gridPane, ++gridRow, Res.get("payment.accepted.countries"), countries).second;
    if (tooltip != null) {
        acceptedCountries.setMouseTransparent(false);
        acceptedCountries.setTooltip(tooltip);
    }
    addLimitations();
}
Also used : TradeCurrency(bisq.core.locale.TradeCurrency) Tooltip(javafx.scene.control.Tooltip) InputTextField(bisq.desktop.components.InputTextField) TextField(javafx.scene.control.TextField)

Example 40 with TextField

use of javafx.scene.control.TextField in project bisq-desktop by bisq-network.

the class TakeOfferView method addSecondRow.

private void addSecondRow() {
    Tuple3<HBox, TextField, Label> priceAsPercentageTuple = getNonEditableValueCurrencyBox();
    HBox priceAsPercentageValueCurrencyBox = priceAsPercentageTuple.first;
    priceAsPercentageTextField = priceAsPercentageTuple.second;
    priceAsPercentageLabel = priceAsPercentageTuple.third;
    Tuple2<Label, VBox> priceAsPercentageInputBoxTuple = getTradeInputBox(priceAsPercentageValueCurrencyBox, Res.get("shared.distanceInPercent"));
    priceAsPercentageDescription = priceAsPercentageInputBoxTuple.first;
    priceAsPercentageDescription.setPrefWidth(220);
    priceAsPercentageInputBox = priceAsPercentageInputBoxTuple.second;
    priceAsPercentageLabel.setText("%");
    priceAsPercentageLabel.getStyleClass().add("percentage-label");
    Tuple3<HBox, TextField, Label> amountValueCurrencyBoxTuple = getNonEditableValueCurrencyBox();
    amountRangeTextField = amountValueCurrencyBoxTuple.second;
    Tuple2<Label, VBox> amountInputBoxTuple = getTradeInputBox(amountValueCurrencyBoxTuple.first, Res.get("takeOffer.amountPriceBox.amountRangeDescription"));
    amountRangeBox = amountInputBoxTuple.second;
    amountRangeBox.setVisible(false);
    Label xLabel = new AutoTooltipLabel("x");
    xLabel.setFont(Font.font("Helvetica-Bold", 20));
    xLabel.setPadding(new Insets(14, 3, 0, 3));
    // we just use it to get the same layout as the upper row
    xLabel.setVisible(false);
    HBox hBox = new HBox();
    hBox.setSpacing(5);
    hBox.setAlignment(Pos.CENTER_LEFT);
    hBox.getChildren().addAll(amountRangeBox, xLabel, priceAsPercentageInputBox);
    GridPane.setRowIndex(hBox, ++gridRow);
    GridPane.setColumnIndex(hBox, 1);
    GridPane.setMargin(hBox, new Insets(5, 10, 5, 0));
    GridPane.setColumnSpan(hBox, 2);
    gridPane.getChildren().add(hBox);
}
Also used : HBox(javafx.scene.layout.HBox) Insets(javafx.geometry.Insets) AutoTooltipLabel(bisq.desktop.components.AutoTooltipLabel) Label(javafx.scene.control.Label) BalanceTextField(bisq.desktop.components.BalanceTextField) InputTextField(bisq.desktop.components.InputTextField) TextField(javafx.scene.control.TextField) FundsTextField(bisq.desktop.components.FundsTextField) AddressTextField(bisq.desktop.components.AddressTextField) AutoTooltipLabel(bisq.desktop.components.AutoTooltipLabel) VBox(javafx.scene.layout.VBox)

Aggregations

TextField (javafx.scene.control.TextField)218 Label (javafx.scene.control.Label)98 Button (javafx.scene.control.Button)68 Insets (javafx.geometry.Insets)62 HBox (javafx.scene.layout.HBox)45 GridPane (javafx.scene.layout.GridPane)44 Scene (javafx.scene.Scene)42 VBox (javafx.scene.layout.VBox)34 InputTextField (bisq.desktop.components.InputTextField)32 Node (javafx.scene.Node)30 Stage (javafx.stage.Stage)27 List (java.util.List)26 ButtonType (javafx.scene.control.ButtonType)23 CheckBox (javafx.scene.control.CheckBox)23 Tooltip (javafx.scene.control.Tooltip)23 StackPane (javafx.scene.layout.StackPane)22 ArrayList (java.util.ArrayList)21 Dialog (javafx.scene.control.Dialog)21 BorderPane (javafx.scene.layout.BorderPane)19 ImageView (javafx.scene.image.ImageView)18