Search in sources :

Example 6 with Tuple3

use of bisq.common.util.Tuple3 in project bisq-desktop by bisq-network.

the class FormBuilder method add3Buttons.

public static Tuple3<Button, Button, Button> add3Buttons(GridPane gridPane, int rowIndex, String title1, String title2, String title3, double top) {
    HBox hBox = new HBox();
    hBox.setSpacing(10);
    Button button1 = new AutoTooltipButton(title1);
    button1.setDefaultButton(true);
    Button button2 = new AutoTooltipButton(title2);
    Button button3 = new AutoTooltipButton(title3);
    hBox.getChildren().addAll(button1, button2, button3);
    GridPane.setRowIndex(hBox, rowIndex);
    GridPane.setColumnIndex(hBox, 1);
    GridPane.setMargin(hBox, new Insets(top, 10, 0, 0));
    gridPane.getChildren().add(hBox);
    return new Tuple3<>(button1, button2, button3);
}
Also used : HBox(javafx.scene.layout.HBox) Insets(javafx.geometry.Insets) Button(javafx.scene.control.Button) AutoTooltipRadioButton(bisq.desktop.components.AutoTooltipRadioButton) RadioButton(javafx.scene.control.RadioButton) AutoTooltipButton(bisq.desktop.components.AutoTooltipButton) Tuple3(bisq.common.util.Tuple3) AutoTooltipButton(bisq.desktop.components.AutoTooltipButton)

Example 7 with Tuple3

use of bisq.common.util.Tuple3 in project bisq-desktop by bisq-network.

the class FormBuilder method addLabelInputTextFieldButton.

// /////////////////////////////////////////////////////////////////////////////////////////
// Label  + InputTextField + Button
// /////////////////////////////////////////////////////////////////////////////////////////
public static Tuple3<Label, InputTextField, Button> addLabelInputTextFieldButton(GridPane gridPane, int rowIndex, String title, String buttonTitle) {
    Label label = addLabel(gridPane, rowIndex, title, 0);
    InputTextField inputTextField = new InputTextField();
    Button button = new AutoTooltipButton(buttonTitle);
    button.setDefaultButton(true);
    HBox hBox = new HBox();
    hBox.setSpacing(10);
    hBox.getChildren().addAll(inputTextField, button);
    HBox.setHgrow(inputTextField, Priority.ALWAYS);
    GridPane.setRowIndex(hBox, rowIndex);
    GridPane.setColumnIndex(hBox, 1);
    gridPane.getChildren().add(hBox);
    return new Tuple3<>(label, inputTextField, button);
}
Also used : HBox(javafx.scene.layout.HBox) Button(javafx.scene.control.Button) AutoTooltipRadioButton(bisq.desktop.components.AutoTooltipRadioButton) RadioButton(javafx.scene.control.RadioButton) AutoTooltipButton(bisq.desktop.components.AutoTooltipButton) InputTextField(bisq.desktop.components.InputTextField) InfoInputTextField(bisq.desktop.components.InfoInputTextField) Tuple3(bisq.common.util.Tuple3) AutoTooltipLabel(bisq.desktop.components.AutoTooltipLabel) Label(javafx.scene.control.Label) AutoTooltipButton(bisq.desktop.components.AutoTooltipButton)

Example 8 with Tuple3

use of bisq.common.util.Tuple3 in project bisq-desktop by bisq-network.

the class AltCoinAccountsView method buildForm.

// /////////////////////////////////////////////////////////////////////////////////////////
// Base form
// /////////////////////////////////////////////////////////////////////////////////////////
private void buildForm() {
    addTitledGroupBg(root, gridRow, 1, Res.get("shared.manageAccounts"));
    Tuple2<Label, ListView> tuple = addLabelListView(root, gridRow, Res.get("account.altcoin.yourAltcoinAccounts"), Layout.FIRST_ROW_DISTANCE);
    GridPane.setValignment(tuple.first, VPos.TOP);
    // noinspection unchecked
    paymentAccountsListView = tuple.second;
    paymentAccountsListView.setPrefHeight(2 * Layout.LIST_ROW_HEIGHT + 14);
    paymentAccountsListView.setCellFactory(new Callback<ListView<PaymentAccount>, ListCell<PaymentAccount>>() {

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

                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 PaymentAccount item, boolean empty) {
                    super.updateItem(item, empty);
                    if (item != null && !empty) {
                        label.setText(item.getAccountName());
                        removeButton.setOnAction(e -> onDeleteAccount(item));
                        setGraphic(pane);
                    } else {
                        setGraphic(null);
                    }
                }
            };
        }
    });
    Tuple3<Button, Button, Button> tuple3 = add3ButtonsAfterGroup(root, ++gridRow, Res.get("shared.addNewAccount"), Res.get("shared.ExportAccounts"), Res.get("shared.importAccounts"));
    addAccountButton = tuple3.first;
    exportButton = tuple3.second;
    importButton = tuple3.third;
}
Also used : Button(javafx.scene.control.Button) TradeCurrency(bisq.core.locale.TradeCurrency) ListView(javafx.scene.control.ListView) ListCell(javafx.scene.control.ListCell) Layout(bisq.desktop.util.Layout) FxmlView(bisq.desktop.common.view.FxmlView) BSFormatter(bisq.desktop.util.BSFormatter) AltCoinAddressValidator(bisq.core.payment.validation.AltCoinAddressValidator) Inject(javax.inject.Inject) PaymentAccountFactory(bisq.core.payment.PaymentAccountFactory) Tuple2(bisq.common.util.Tuple2) CryptoCurrencyForm(bisq.desktop.components.paymentmethods.CryptoCurrencyForm) Tuple3(bisq.common.util.Tuple3) VPos(javafx.geometry.VPos) Res(bisq.core.locale.Res) Callback(javafx.util.Callback) TitledGroupBg(bisq.desktop.components.TitledGroupBg) GridPane(javafx.scene.layout.GridPane) FormBuilder.addLabelListView(bisq.desktop.util.FormBuilder.addLabelListView) FormBuilder.add3ButtonsAfterGroup(bisq.desktop.util.FormBuilder.add3ButtonsAfterGroup) Popup(bisq.desktop.main.overlays.popups.Popup) Label(javafx.scene.control.Label) AutoTooltipLabel(bisq.desktop.components.AutoTooltipLabel) FormBuilder.addTitledGroupBg(bisq.desktop.util.FormBuilder.addTitledGroupBg) FormBuilder(bisq.desktop.util.FormBuilder) PaymentMethod(bisq.core.payment.payload.PaymentMethod) AccountAgeWitnessService(bisq.core.payment.AccountAgeWitnessService) TimeUnit(java.util.concurrent.TimeUnit) PaymentMethodForm(bisq.desktop.components.paymentmethods.PaymentMethodForm) PaymentAccount(bisq.core.payment.PaymentAccount) InputValidator(bisq.core.util.validation.InputValidator) FormBuilder.add2ButtonsAfterGroup(bisq.desktop.util.FormBuilder.add2ButtonsAfterGroup) CryptoCurrency(bisq.core.locale.CryptoCurrency) ImageUtil(bisq.desktop.util.ImageUtil) AnchorPane(javafx.scene.layout.AnchorPane) ImageView(javafx.scene.image.ImageView) AutoTooltipButton(bisq.desktop.components.AutoTooltipButton) UserThread(bisq.common.UserThread) ActivatableViewAndModel(bisq.desktop.common.view.ActivatableViewAndModel) ChangeListener(javafx.beans.value.ChangeListener) PaymentAccount(bisq.core.payment.PaymentAccount) 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) FormBuilder.addLabelListView(bisq.desktop.util.FormBuilder.addLabelListView) Button(javafx.scene.control.Button) AutoTooltipButton(bisq.desktop.components.AutoTooltipButton) ImageView(javafx.scene.image.ImageView) AutoTooltipLabel(bisq.desktop.components.AutoTooltipLabel) AnchorPane(javafx.scene.layout.AnchorPane)

Example 9 with Tuple3

use of bisq.common.util.Tuple3 in project bisq-desktop by bisq-network.

the class FormBuilder method getEditableValueCurrencyBoxWithInfo.

public static Tuple3<HBox, InfoInputTextField, Label> getEditableValueCurrencyBoxWithInfo(String promptText) {
    InfoInputTextField infoInputTextField = new InfoInputTextField();
    InputTextField input = infoInputTextField.getTextField();
    input.setPrefWidth(170);
    input.setAlignment(Pos.CENTER_RIGHT);
    input.setId("text-input-with-currency-text-field");
    input.setPromptText(promptText);
    Label currency = new AutoTooltipLabel(Res.getBaseCurrencyCode());
    currency.setId("currency-info-label");
    HBox box = new HBox();
    box.getChildren().addAll(infoInputTextField, currency);
    return new Tuple3<>(box, infoInputTextField, currency);
}
Also used : HBox(javafx.scene.layout.HBox) InputTextField(bisq.desktop.components.InputTextField) InfoInputTextField(bisq.desktop.components.InfoInputTextField) Tuple3(bisq.common.util.Tuple3) AutoTooltipLabel(bisq.desktop.components.AutoTooltipLabel) Label(javafx.scene.control.Label) InfoInputTextField(bisq.desktop.components.InfoInputTextField) AutoTooltipLabel(bisq.desktop.components.AutoTooltipLabel)

Example 10 with Tuple3

use of bisq.common.util.Tuple3 in project bisq-desktop by bisq-network.

the class FormBuilder method getNonEditableValueCurrencyBox.

public static Tuple3<HBox, TextField, Label> getNonEditableValueCurrencyBox() {
    TextField textField = new InputTextField();
    textField.setPrefWidth(190);
    textField.setAlignment(Pos.CENTER_RIGHT);
    textField.setId("text-input-with-currency-text-field");
    textField.setMouseTransparent(true);
    textField.setEditable(false);
    textField.setFocusTraversable(false);
    Label currency = new AutoTooltipLabel(Res.getBaseCurrencyCode());
    currency.setId("currency-info-label-disabled");
    HBox box = new HBox();
    box.getChildren().addAll(textField, currency);
    return new Tuple3<>(box, textField, currency);
}
Also used : HBox(javafx.scene.layout.HBox) InputTextField(bisq.desktop.components.InputTextField) InfoInputTextField(bisq.desktop.components.InfoInputTextField) Tuple3(bisq.common.util.Tuple3) AutoTooltipLabel(bisq.desktop.components.AutoTooltipLabel) Label(javafx.scene.control.Label) BalanceTextField(bisq.desktop.components.BalanceTextField) InputTextField(bisq.desktop.components.InputTextField) InfoInputTextField(bisq.desktop.components.InfoInputTextField) PasswordTextField(bisq.desktop.components.PasswordTextField) InfoTextField(bisq.desktop.components.InfoTextField) TextField(javafx.scene.control.TextField) TxIdTextField(bisq.desktop.components.TxIdTextField) BsqAddressTextField(bisq.desktop.components.BsqAddressTextField) FundsTextField(bisq.desktop.components.FundsTextField) AddressTextField(bisq.desktop.components.AddressTextField) AutoTooltipLabel(bisq.desktop.components.AutoTooltipLabel)

Aggregations

Tuple3 (bisq.common.util.Tuple3)17 AutoTooltipLabel (bisq.desktop.components.AutoTooltipLabel)16 Label (javafx.scene.control.Label)15 HBox (javafx.scene.layout.HBox)15 Insets (javafx.geometry.Insets)9 AutoTooltipButton (bisq.desktop.components.AutoTooltipButton)8 InfoInputTextField (bisq.desktop.components.InfoInputTextField)8 InputTextField (bisq.desktop.components.InputTextField)8 Button (javafx.scene.control.Button)8 AutoTooltipRadioButton (bisq.desktop.components.AutoTooltipRadioButton)6 ComboBox (javafx.scene.control.ComboBox)6 RadioButton (javafx.scene.control.RadioButton)6 Res (bisq.core.locale.Res)3 PaymentAccount (bisq.core.payment.PaymentAccount)3 PaymentMethod (bisq.core.payment.payload.PaymentMethod)3 ActivatableViewAndModel (bisq.desktop.common.view.ActivatableViewAndModel)3 FxmlView (bisq.desktop.common.view.FxmlView)3 SearchComboBox (bisq.desktop.components.SearchComboBox)3 Popup (bisq.desktop.main.overlays.popups.Popup)3 BSFormatter (bisq.desktop.util.BSFormatter)3