Search in sources :

Example 31 with InputTextField

use of bisq.desktop.components.InputTextField 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)

Example 32 with InputTextField

use of bisq.desktop.components.InputTextField in project bisq-desktop by bisq-network.

the class FormBuilder method addLabelInputTextFieldCheckBox.

// /////////////////////////////////////////////////////////////////////////////////////////
// Label  + InputTextField + CheckBox
// /////////////////////////////////////////////////////////////////////////////////////////
public static Tuple3<Label, InputTextField, CheckBox> addLabelInputTextFieldCheckBox(GridPane gridPane, int rowIndex, String title, String checkBoxTitle) {
    Label label = addLabel(gridPane, rowIndex, title, 0);
    InputTextField inputTextField = new InputTextField();
    CheckBox checkBox = new AutoTooltipCheckBox(checkBoxTitle);
    HBox.setMargin(checkBox, new Insets(4, 0, 0, 0));
    HBox hBox = new HBox();
    hBox.setSpacing(10);
    hBox.getChildren().addAll(inputTextField, checkBox);
    GridPane.setRowIndex(hBox, rowIndex);
    GridPane.setColumnIndex(hBox, 1);
    gridPane.getChildren().add(hBox);
    return new Tuple3<>(label, inputTextField, checkBox);
}
Also used : AutoTooltipCheckBox(bisq.desktop.components.AutoTooltipCheckBox) HBox(javafx.scene.layout.HBox) Insets(javafx.geometry.Insets) InputTextField(bisq.desktop.components.InputTextField) InfoInputTextField(bisq.desktop.components.InfoInputTextField) CheckBox(javafx.scene.control.CheckBox) AutoTooltipCheckBox(bisq.desktop.components.AutoTooltipCheckBox) Tuple3(bisq.common.util.Tuple3) AutoTooltipLabel(bisq.desktop.components.AutoTooltipLabel) Label(javafx.scene.control.Label)

Example 33 with InputTextField

use of bisq.desktop.components.InputTextField in project bisq-desktop by bisq-network.

the class FormBuilder method getEditableValueCurrencyBox.

// /////////////////////////////////////////////////////////////////////////////////////////
// Trade: HBox, InputTextField, Label
// /////////////////////////////////////////////////////////////////////////////////////////
public static Tuple3<HBox, InputTextField, Label> getEditableValueCurrencyBox(String promptText) {
    InputTextField input = new InputTextField();
    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(input, currency);
    return new Tuple3<>(box, input, 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) AutoTooltipLabel(bisq.desktop.components.AutoTooltipLabel)

Example 34 with InputTextField

use of bisq.desktop.components.InputTextField in project bisq-desktop by bisq-network.

the class SendPrivateNotificationWindow method addContent.

private void addContent() {
    InputTextField keyInputTextField = addLabelInputTextField(gridPane, ++rowIndex, Res.get("shared.unlock"), 10).second;
    if (useDevPrivilegeKeys)
        keyInputTextField.setText(DevEnv.DEV_PRIVILEGE_PRIV_KEY);
    Tuple2<Label, TextArea> labelTextAreaTuple2 = addLabelTextArea(gridPane, ++rowIndex, Res.get("sendPrivateNotificationWindow.privateNotification"), Res.get("sendPrivateNotificationWindow.enterNotification"));
    TextArea alertMessageTextArea = labelTextAreaTuple2.second;
    Label first = labelTextAreaTuple2.first;
    first.setMinWidth(200);
    Button sendButton = new AutoTooltipButton(Res.get("sendPrivateNotificationWindow.send"));
    sendButton.setOnAction(e -> {
        if (alertMessageTextArea.getText().length() > 0 && keyInputTextField.getText().length() > 0) {
            if (!sendPrivateNotificationHandler.handle(new PrivateNotificationPayload(alertMessageTextArea.getText()), pubKeyRing, nodeAddress, keyInputTextField.getText(), new SendMailboxMessageListener() {

                @Override
                public void onArrived() {
                    log.info("PrivateNotificationMessage arrived at peer.");
                    new Popup<>().feedback(Res.get("shared.messageArrived")).onClose(SendPrivateNotificationWindow.this::hide).show();
                }

                @Override
                public void onStoredInMailbox() {
                    log.info("PrivateNotificationMessage was stored in mailbox.");
                    new Popup<>().feedback(Res.get("shared.messageStoredInMailbox")).onClose(SendPrivateNotificationWindow.this::hide).show();
                }

                @Override
                public void onFault(String errorMessage) {
                    log.error("sendEncryptedMailboxMessage failed. message=" + message);
                    new Popup<>().feedback(Res.get("shared.messageSendingFailed", errorMessage)).onClose(SendPrivateNotificationWindow.this::hide).show();
                }
            }))
                new Popup<>().warning(Res.get("shared.invalidKey")).width(300).onClose(this::blurAgain).show();
        }
    });
    closeButton = new AutoTooltipButton(Res.get("shared.close"));
    closeButton.setOnAction(e -> {
        hide();
        closeHandlerOptional.ifPresent(Runnable::run);
    });
    HBox hBox = new HBox();
    hBox.setSpacing(10);
    GridPane.setRowIndex(hBox, ++rowIndex);
    GridPane.setColumnIndex(hBox, 1);
    hBox.getChildren().addAll(sendButton, closeButton);
    gridPane.getChildren().add(hBox);
    GridPane.setMargin(hBox, new Insets(10, 0, 0, 0));
}
Also used : HBox(javafx.scene.layout.HBox) Insets(javafx.geometry.Insets) TextArea(javafx.scene.control.TextArea) FormBuilder.addLabelTextArea(bisq.desktop.util.FormBuilder.addLabelTextArea) FormBuilder.addLabelInputTextField(bisq.desktop.util.FormBuilder.addLabelInputTextField) InputTextField(bisq.desktop.components.InputTextField) Label(javafx.scene.control.Label) AutoTooltipButton(bisq.desktop.components.AutoTooltipButton) Button(javafx.scene.control.Button) AutoTooltipButton(bisq.desktop.components.AutoTooltipButton) PrivateNotificationPayload(bisq.core.alert.PrivateNotificationPayload) SendMailboxMessageListener(bisq.network.p2p.SendMailboxMessageListener)

Example 35 with InputTextField

use of bisq.desktop.components.InputTextField in project bisq-desktop by bisq-network.

the class UnlockArbitrationRegistrationWindow method addInputFields.

private void addInputFields() {
    Label label = new AutoTooltipLabel(Res.get("shared.enterPrivKey"));
    label.setWrapText(true);
    GridPane.setMargin(label, new Insets(3, 0, 0, 0));
    GridPane.setRowIndex(label, ++rowIndex);
    keyInputTextField = new InputTextField();
    if (useDevPrivilegeKeys)
        keyInputTextField.setText(DevEnv.DEV_PRIVILEGE_PRIV_KEY);
    GridPane.setMargin(keyInputTextField, new Insets(3, 0, 0, 0));
    GridPane.setRowIndex(keyInputTextField, rowIndex);
    GridPane.setColumnIndex(keyInputTextField, 1);
    changeListener = (observable, oldValue, newValue) -> unlockButton.setDisable(newValue.length() == 0);
    keyInputTextField.textProperty().addListener(changeListener);
    gridPane.getChildren().addAll(label, keyInputTextField);
}
Also used : Insets(javafx.geometry.Insets) InputTextField(bisq.desktop.components.InputTextField) Label(javafx.scene.control.Label) AutoTooltipLabel(bisq.desktop.components.AutoTooltipLabel) AutoTooltipLabel(bisq.desktop.components.AutoTooltipLabel)

Aggregations

InputTextField (bisq.desktop.components.InputTextField)35 Label (javafx.scene.control.Label)23 HBox (javafx.scene.layout.HBox)19 AutoTooltipLabel (bisq.desktop.components.AutoTooltipLabel)17 Insets (javafx.geometry.Insets)15 TradeCurrency (bisq.core.locale.TradeCurrency)11 InfoInputTextField (bisq.desktop.components.InfoInputTextField)11 FormBuilder.addLabelInputTextField (bisq.desktop.util.FormBuilder.addLabelInputTextField)11 Popup (bisq.desktop.main.overlays.popups.Popup)8 Tuple3 (bisq.common.util.Tuple3)6 AutoTooltipButton (bisq.desktop.components.AutoTooltipButton)6 Button (javafx.scene.control.Button)5 TextField (javafx.scene.control.TextField)5 CheckBox (javafx.scene.control.CheckBox)4 Country (bisq.core.locale.Country)3 AddressTextField (bisq.desktop.components.AddressTextField)3 VBox (javafx.scene.layout.VBox)3 BalanceTextField (bisq.desktop.components.BalanceTextField)2 FundsTextField (bisq.desktop.components.FundsTextField)2 TitledGroupBg (bisq.desktop.components.TitledGroupBg)2