Search in sources :

Example 1 with PasswordValidator

use of bisq.desktop.util.validation.PasswordValidator 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)

Aggregations

AutoTooltipLabel (bisq.desktop.components.AutoTooltipLabel)1 PasswordTextField (bisq.desktop.components.PasswordTextField)1 PasswordValidator (bisq.desktop.util.validation.PasswordValidator)1 Insets (javafx.geometry.Insets)1 Label (javafx.scene.control.Label)1