correct wrong method name

This commit is contained in:
Armin Schrenk
2020-11-20 17:29:56 +01:00
parent dc4fd482b5
commit e82167b5e6

View File

@@ -39,7 +39,7 @@ public class GeneralVaultOptionsController implements FxController {
public void initialize() {
vaultName.textProperty().set(vault.getVaultSettings().displayName().get());
vaultName.focusedProperty().addListener(this::trimVaultNameOnFocusLoss);
vaultName.setTextFormatter(new TextFormatter<>(this::checkVaultNameLength));
vaultName.setTextFormatter(new TextFormatter<>(this::removeWhitespaces));
unlockOnStartupCheckbox.selectedProperty().bindBidirectional(vault.getVaultSettings().unlockAfterStartup());
actionAfterUnlockChoiceBox.getItems().addAll(WhenUnlocked.values());
actionAfterUnlockChoiceBox.valueProperty().bindBidirectional(vault.getVaultSettings().actionAfterUnlock());
@@ -53,7 +53,7 @@ public class GeneralVaultOptionsController implements FxController {
}
}
private TextFormatter.Change checkVaultNameLength(TextFormatter.Change change) {
private TextFormatter.Change removeWhitespaces(TextFormatter.Change change) {
if (change.isContentChange() && change.getControlNewText().length() > VAULTNAME_TRUNCATE_THRESHOLD) {
return null; // reject any change that would lead to a text exceeding threshold
} else {