Search in sources :

Example 26 with TextField

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

the class ArbitratorRegistrationView method buildUI.

private void buildUI() {
    GridPane gridPane = new GridPane();
    gridPane.setPadding(new Insets(30, 25, -1, 25));
    gridPane.setHgap(5);
    gridPane.setVgap(5);
    ColumnConstraints columnConstraints1 = new ColumnConstraints();
    columnConstraints1.setHalignment(HPos.RIGHT);
    columnConstraints1.setHgrow(Priority.SOMETIMES);
    columnConstraints1.setMinWidth(200);
    ColumnConstraints columnConstraints2 = new ColumnConstraints();
    columnConstraints2.setHgrow(Priority.ALWAYS);
    gridPane.getColumnConstraints().addAll(columnConstraints1, columnConstraints2);
    root.getChildren().add(gridPane);
    addTitledGroupBg(gridPane, gridRow, 3, Res.get("account.tab.arbitratorRegistration"));
    TextField pubKeyTextField = FormBuilder.addLabelTextField(gridPane, gridRow, Res.get("account.arbitratorRegistration.pubKey"), model.registrationPubKeyAsHex.get(), Layout.FIRST_ROW_DISTANCE).second;
    pubKeyTextField.textProperty().bind(model.registrationPubKeyAsHex);
    Tuple2<Label, ListView> tuple = addLabelListView(gridPane, ++gridRow, Res.get("shared.yourLanguage"));
    GridPane.setValignment(tuple.first, VPos.TOP);
    // noinspection unchecked
    languagesListView = tuple.second;
    languagesListView.disableProperty().bind(model.registrationEditDisabled);
    languagesListView.setMinHeight(3 * Layout.LIST_ROW_HEIGHT + 2);
    languagesListView.setMaxHeight(6 * Layout.LIST_ROW_HEIGHT + 2);
    languagesListView.setCellFactory(new Callback<ListView<String>, ListCell<String>>() {

        @Override
        public ListCell<String> call(ListView<String> list) {
            return new ListCell<String>() {

                final Label label = new AutoTooltipLabel();

                final ImageView icon = ImageUtil.getImageViewById(ImageUtil.REMOVE_ICON);

                final Button removeButton = new AutoTooltipButton("", icon);

                final AnchorPane pane = new AnchorPane(label, removeButton);

                {
                    label.setLayoutY(5);
                    removeButton.setId("icon-button");
                    AnchorPane.setRightAnchor(removeButton, 0d);
                }

                @Override
                public void updateItem(final String item, boolean empty) {
                    super.updateItem(item, empty);
                    if (item != null && !empty) {
                        label.setText(LanguageUtil.getDisplayName(item));
                        removeButton.setOnAction(e -> onRemoveLanguage(item));
                        setGraphic(pane);
                    } else {
                        setGraphic(null);
                    }
                }
            };
        }
    });
    // noinspection unchecked
    languageComboBox = addLabelComboBox(gridPane, ++gridRow).second;
    languageComboBox.disableProperty().bind(model.registrationEditDisabled);
    languageComboBox.setPromptText(Res.get("shared.addLanguage"));
    languageComboBox.setConverter(new StringConverter<String>() {

        @Override
        public String toString(String code) {
            return LanguageUtil.getDisplayName(code);
        }

        @Override
        public String fromString(String s) {
            return null;
        }
    });
    languageComboBox.setOnAction(e -> onAddLanguage());
    Button registerButton = addButtonAfterGroup(gridPane, ++gridRow, Res.get("account.arbitratorRegistration.register"));
    registerButton.disableProperty().bind(model.registrationEditDisabled);
    registerButton.setOnAction(e -> onRegister());
    Button revokeButton = addButton(gridPane, ++gridRow, Res.get("account.arbitratorRegistration.revoke"));
    revokeButton.setDefaultButton(false);
    revokeButton.disableProperty().bind(model.revokeButtonDisabled);
    revokeButton.setOnAction(e -> onRevoke());
    addTitledGroupBg(gridPane, ++gridRow, 2, Res.get("shared.information"), Layout.GROUP_DISTANCE);
    Label infoLabel = addMultilineLabel(gridPane, gridRow);
    GridPane.setMargin(infoLabel, new Insets(Layout.FIRST_ROW_AND_GROUP_DISTANCE, 0, 0, 0));
    infoLabel.setText(Res.get("account.arbitratorRegistration.info.msg"));
}
Also used : Button(javafx.scene.control.Button) Arbitrator(bisq.core.arbitration.Arbitrator) HPos(javafx.geometry.HPos) ListView(javafx.scene.control.ListView) ColumnConstraints(javafx.scene.layout.ColumnConstraints) ListCell(javafx.scene.control.ListCell) UnlockArbitrationRegistrationWindow(bisq.desktop.main.overlays.windows.UnlockArbitrationRegistrationWindow) Layout(bisq.desktop.util.Layout) VBox(javafx.scene.layout.VBox) FxmlView(bisq.desktop.common.view.FxmlView) Inject(javax.inject.Inject) Tuple2(bisq.common.util.Tuple2) Insets(javafx.geometry.Insets) ComboBox(javafx.scene.control.ComboBox) ListChangeListener(javafx.collections.ListChangeListener) VPos(javafx.geometry.VPos) Res(bisq.core.locale.Res) Callback(javafx.util.Callback) GridPane(javafx.scene.layout.GridPane) Popup(bisq.desktop.main.overlays.popups.Popup) TextField(javafx.scene.control.TextField) Label(javafx.scene.control.Label) AutoTooltipLabel(bisq.desktop.components.AutoTooltipLabel) FormBuilder(bisq.desktop.util.FormBuilder) StringConverter(javafx.util.StringConverter) Priority(javafx.scene.layout.Priority) ImageUtil(bisq.desktop.util.ImageUtil) AnchorPane(javafx.scene.layout.AnchorPane) ImageView(javafx.scene.image.ImageView) AutoTooltipButton(bisq.desktop.components.AutoTooltipButton) AppOptionKeys(bisq.core.app.AppOptionKeys) LanguageUtil(bisq.core.locale.LanguageUtil) UserThread(bisq.common.UserThread) Named(com.google.inject.name.Named) ActivatableViewAndModel(bisq.desktop.common.view.ActivatableViewAndModel) ChangeListener(javafx.beans.value.ChangeListener) GridPane(javafx.scene.layout.GridPane) Insets(javafx.geometry.Insets) ColumnConstraints(javafx.scene.layout.ColumnConstraints) ListCell(javafx.scene.control.ListCell) Label(javafx.scene.control.Label) AutoTooltipLabel(bisq.desktop.components.AutoTooltipLabel) AutoTooltipButton(bisq.desktop.components.AutoTooltipButton) ListView(javafx.scene.control.ListView) Button(javafx.scene.control.Button) AutoTooltipButton(bisq.desktop.components.AutoTooltipButton) TextField(javafx.scene.control.TextField) ImageView(javafx.scene.image.ImageView) AutoTooltipLabel(bisq.desktop.components.AutoTooltipLabel) AnchorPane(javafx.scene.layout.AnchorPane)

Example 27 with TextField

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

the class AliPayForm method addFormForDisplayAccount.

@Override
public void addFormForDisplayAccount() {
    gridRowFrom = gridRow;
    addLabelTextField(gridPane, gridRow, Res.get("payment.account.name"), aliPayAccount.getAccountName(), Layout.FIRST_ROW_AND_GROUP_DISTANCE);
    addLabelTextField(gridPane, ++gridRow, Res.getWithCol("shared.paymentMethod"), Res.get(aliPayAccount.getPaymentMethod().getId()));
    TextField field = addLabelTextField(gridPane, ++gridRow, Res.get("payment.account.no"), aliPayAccount.getAccountNr()).second;
    field.setMouseTransparent(false);
    final TradeCurrency singleTradeCurrency = aliPayAccount.getSingleTradeCurrency();
    final String nameAndCode = singleTradeCurrency != null ? singleTradeCurrency.getNameAndCode() : "";
    addLabelTextField(gridPane, ++gridRow, Res.getWithCol("shared.currency"), nameAndCode);
    addLimitations();
}
Also used : TradeCurrency(bisq.core.locale.TradeCurrency) TextField(javafx.scene.control.TextField) FormBuilder.addLabelInputTextField(bisq.desktop.util.FormBuilder.addLabelInputTextField) FormBuilder.addLabelTextField(bisq.desktop.util.FormBuilder.addLabelTextField) InputTextField(bisq.desktop.components.InputTextField)

Example 28 with TextField

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

the class BankForm method addHolderNameAndIdForDisplayAccount.

protected void addHolderNameAndIdForDisplayAccount() {
    String countryCode = bankAccountPayload.getCountryCode();
    if (BankUtil.isHolderIdRequired(countryCode)) {
        Tuple4<Label, TextField, Label, TextField> tuple = addLabelTextFieldLabelTextField(gridPane, ++gridRow, Res.getWithCol("payment.account.owner"), BankUtil.getHolderIdLabel(countryCode));
        TextField holderNameTextField = tuple.second;
        holderNameTextField.setText(bankAccountPayload.getHolderName());
        holderNameTextField.setMinWidth(250);
        tuple.forth.setText(bankAccountPayload.getHolderTaxId());
    } else {
        addLabelTextField(gridPane, ++gridRow, Res.getWithCol("payment.account.owner"), bankAccountPayload.getHolderName());
    }
}
Also used : Label(javafx.scene.control.Label) InputTextField(bisq.desktop.components.InputTextField) TextField(javafx.scene.control.TextField)

Example 29 with TextField

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

the class CashAppForm 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.cashApp.cashTag"), account.getCashTag()).second;
    field.setMouseTransparent(false);
    final TradeCurrency singleTradeCurrency = account.getSingleTradeCurrency();
    final String nameAndCode = singleTradeCurrency != null ? singleTradeCurrency.getNameAndCode() : "";
    addLabelTextField(gridPane, ++gridRow, Res.getWithCol("shared.currency"), nameAndCode);
    addLimitations();
}
Also used : TradeCurrency(bisq.core.locale.TradeCurrency) TextField(javafx.scene.control.TextField) FormBuilder.addLabelInputTextField(bisq.desktop.util.FormBuilder.addLabelInputTextField) FormBuilder.addLabelTextField(bisq.desktop.util.FormBuilder.addLabelTextField) InputTextField(bisq.desktop.components.InputTextField)

Example 30 with TextField

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

the class ChaseQuickPayForm method addFormForDisplayAccount.

@Override
public void addFormForDisplayAccount() {
    gridRowFrom = gridRow;
    FormBuilder.addLabelTextField(gridPane, gridRow, Res.get("payment.account.name"), chaseQuickPayAccount.getAccountName(), Layout.FIRST_ROW_AND_GROUP_DISTANCE);
    FormBuilder.addLabelTextField(gridPane, ++gridRow, Res.getWithCol("shared.paymentMethod"), Res.get(chaseQuickPayAccount.getPaymentMethod().getId()));
    FormBuilder.addLabelTextField(gridPane, ++gridRow, Res.getWithCol("payment.account.owner"), chaseQuickPayAccount.getHolderName());
    TextField field = FormBuilder.addLabelTextField(gridPane, ++gridRow, Res.get("payment.email"), chaseQuickPayAccount.getEmail()).second;
    field.setMouseTransparent(false);
    TradeCurrency singleTradeCurrency = chaseQuickPayAccount.getSingleTradeCurrency();
    String nameAndCode = singleTradeCurrency != null ? singleTradeCurrency.getNameAndCode() : "null";
    FormBuilder.addLabelTextField(gridPane, ++gridRow, Res.getWithCol("shared.currency"), nameAndCode);
    addLimitations();
}
Also used : TradeCurrency(bisq.core.locale.TradeCurrency) TextField(javafx.scene.control.TextField) InputTextField(bisq.desktop.components.InputTextField)

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