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);
}
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);
}
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);
}
Aggregations