Search in sources :

Example 1 with PasswordTextField

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

the class FormBuilder method addLabelPasswordTextField.

public static Tuple2<Label, PasswordTextField> addLabelPasswordTextField(GridPane gridPane, int rowIndex, String title, double top) {
    Label label = addLabel(gridPane, rowIndex, title, top);
    PasswordTextField passwordField = new PasswordTextField();
    GridPane.setRowIndex(passwordField, rowIndex);
    GridPane.setColumnIndex(passwordField, 1);
    GridPane.setMargin(passwordField, new Insets(top, 0, 0, 0));
    gridPane.getChildren().add(passwordField);
    return new Tuple2<>(label, passwordField);
}
Also used : Insets(javafx.geometry.Insets) Tuple2(bisq.common.util.Tuple2) AutoTooltipLabel(bisq.desktop.components.AutoTooltipLabel) Label(javafx.scene.control.Label) PasswordTextField(bisq.desktop.components.PasswordTextField)

Example 2 with PasswordTextField

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

the class WalletPasswordWindow method addInputFields.

private void addInputFields() {
    Label label = new AutoTooltipLabel(Res.get("password.enterPassword"));
    label.setWrapText(true);
    GridPane.setMargin(label, new Insets(3, 0, 0, 0));
    GridPane.setRowIndex(label, ++rowIndex);
    passwordTextField = new PasswordTextField();
    GridPane.setMargin(passwordTextField, new Insets(3, 0, 0, 0));
    GridPane.setRowIndex(passwordTextField, rowIndex);
    GridPane.setColumnIndex(passwordTextField, 1);
    PasswordValidator passwordValidator = new PasswordValidator();
    changeListener = (observable, oldValue, newValue) -> unlockButton.setDisable(!passwordValidator.validate(newValue).isValid);
    passwordTextField.textProperty().addListener(changeListener);
    gridPane.getChildren().addAll(label, passwordTextField);
}
Also used : Insets(javafx.geometry.Insets) AutoTooltipLabel(bisq.desktop.components.AutoTooltipLabel) Label(javafx.scene.control.Label) PasswordValidator(bisq.desktop.util.validation.PasswordValidator) PasswordTextField(bisq.desktop.components.PasswordTextField) AutoTooltipLabel(bisq.desktop.components.AutoTooltipLabel)

Example 3 with PasswordTextField

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

the class PasswordView method initialize.

@Override
public void initialize() {
    headline = FormBuilder.addTitledGroupBg(root, gridRow, 2, "");
    passwordField = FormBuilder.addLabelPasswordTextField(root, gridRow, Res.get("password.enterPassword"), Layout.FIRST_ROW_DISTANCE).second;
    passwordField.setValidator(passwordValidator);
    passwordFieldChangeListener = (observable, oldValue, newValue) -> validatePasswords();
    Tuple2<Label, PasswordTextField> tuple2 = FormBuilder.addLabelPasswordTextField(root, ++gridRow, Res.get("password.confirmPassword"));
    repeatedPasswordLabel = tuple2.first;
    repeatedPasswordField = tuple2.second;
    repeatedPasswordField.setValidator(passwordValidator);
    repeatedPasswordFieldChangeListener = (observable, oldValue, newValue) -> validatePasswords();
    Tuple3<Button, BusyAnimation, Label> tuple = FormBuilder.addButtonBusyAnimationLabel(root, ++gridRow, "", 15);
    pwButton = tuple.first;
    BusyAnimation busyAnimation = tuple.second;
    Label deriveStatusLabel = tuple.third;
    pwButton.setDisable(true);
    setText();
    pwButton.setOnAction(e -> {
        if (!walletsManager.areWalletsEncrypted()) {
            new Popup<>().backgroundInfo(Res.get("password.backupReminder")).closeButtonText(Res.get("password.backupWasDone")).onClose(() -> onApplyPassword(busyAnimation, deriveStatusLabel)).actionButtonTextWithGoTo("navigation.account.walletSeed").onAction(() -> {
                navigation.setReturnPath(navigation.getCurrentPath());
                // noinspection unchecked
                navigation.navigateTo(MainView.class, AccountView.class, AccountSettingsView.class, SeedWordsView.class);
            }).show();
        } else {
            onApplyPassword(busyAnimation, deriveStatusLabel);
        }
    });
    FormBuilder.addTitledGroupBg(root, ++gridRow, 1, Res.get("shared.information"), Layout.GROUP_DISTANCE);
    FormBuilder.addMultilineLabel(root, gridRow, Res.get("account.password.info"), Layout.FIRST_ROW_AND_GROUP_DISTANCE);
}
Also used : BusyAnimation(bisq.desktop.components.BusyAnimation) AccountSettingsView(bisq.desktop.main.account.settings.AccountSettingsView) MainView(bisq.desktop.main.MainView) Button(javafx.scene.control.Button) SeedWordsView(bisq.desktop.main.account.content.seedwords.SeedWordsView) Popup(bisq.desktop.main.overlays.popups.Popup) Label(javafx.scene.control.Label) AccountView(bisq.desktop.main.account.AccountView) PasswordTextField(bisq.desktop.components.PasswordTextField)

Aggregations

PasswordTextField (bisq.desktop.components.PasswordTextField)3 Label (javafx.scene.control.Label)3 AutoTooltipLabel (bisq.desktop.components.AutoTooltipLabel)2 Insets (javafx.geometry.Insets)2 Tuple2 (bisq.common.util.Tuple2)1 BusyAnimation (bisq.desktop.components.BusyAnimation)1 MainView (bisq.desktop.main.MainView)1 AccountView (bisq.desktop.main.account.AccountView)1 SeedWordsView (bisq.desktop.main.account.content.seedwords.SeedWordsView)1 AccountSettingsView (bisq.desktop.main.account.settings.AccountSettingsView)1 Popup (bisq.desktop.main.overlays.popups.Popup)1 PasswordValidator (bisq.desktop.util.validation.PasswordValidator)1 Button (javafx.scene.control.Button)1