use of javafx.scene.control.TextInputControl in project JFoenix by jfoenixadmin.
the class NumberValidator method evalTextInputField.
private void evalTextInputField() {
TextInputControl textField = (TextInputControl) srcControl.get();
String text = textField.getText();
try {
hasErrors.set(false);
if (!text.isEmpty())
numberStringConverter.fromString(text);
} catch (Exception e) {
hasErrors.set(true);
}
}
use of javafx.scene.control.TextInputControl in project JFoenix by jfoenixadmin.
the class RegexValidator method evalTextInputField.
private void evalTextInputField() {
TextInputControl textField = (TextInputControl) srcControl.get();
// Treat null like empty string
String text = (textField.getText() == null) ? "" : textField.getText();
if (regexPatternCompiled.matcher(text).matches()) {
hasErrors.set(false);
} else {
hasErrors.set(true);
}
}
Aggregations