下面列出了javafx.scene.control.TextInputControl#getText ( ) 实例代码,或者点击链接到github查看源代码,也可以在右侧发表评论。
private void evalTextInputField() {
TextInputControl textField = (TextInputControl) srcControl.get();
String text = textField.getText();
hasErrors.set(false);
if (!passwordsMatch) {
hasErrors.set(true);
message.set(Res.get("password.passwordsDoNotMatch"));
} else if (text.length() < 8) {
hasErrors.set(true);
message.set(Res.get("validation.passwordTooShort"));
} else if (text.length() > 50) {
hasErrors.set(true);
message.set(Res.get("validation.passwordTooLong"));
}
}
private void lookup(final TextInputControl field)
{
final String text = field.getText();
synchronized (results)
{
results.clear();
}
proposal_service.lookup(text, (name, priority, proposals) -> handleLookupResult(field, text, name, priority, proposals));
}
private void evalTextInputField() {
TextInputControl textField = (TextInputControl) srcControl.get();
String text = textField.getText();
try {
hasErrors.set(false);
if (!text.isEmpty()) {
Integer.parseInt(text);
}
} catch (Exception e) {
hasErrors.set(true);
}
}
private void evalTextInputField() {
TextInputControl textField = (TextInputControl) srcControl.get();
if (textField.getText() == null || textField.getText().isEmpty()) {
hasErrors.set(true);
} else {
hasErrors.set(false);
}
}
private void evalTextInputField() {
TextInputControl textField = (TextInputControl) srcControl.get();
String text = textField.getText();
hasErrors.set(false);
if (!text.isEmpty()) {
if (text.length() > StringLength - 1) {
hasErrors.set(true);
// textField.textProperty().set(text.substring(0, 19));
}
}
}
private void evalTextInputField() {
TextInputControl textField = (TextInputControl) srcControl.get();
String text = (textField.getText() == null) ? "" : textField.getText(); // Treat null like empty string
if (regexPatternCompiled.matcher(text).matches()) {
hasErrors.set(false);
} else {
hasErrors.set(true);
}
}
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);
}
}
private double computeTextContentWidth(TextInputControl editor) {
Text text = new Text(editor.getText());
text.setFont(editor.getFont());
text.applyCss();
return text.getLayoutBounds().getWidth();
}