private void addEnterKeyHandler(final PropertyEditorFieldInfo property,
final PropertyEditorTextBox textBox) {
textBox.addKeyDownHandler(new KeyDownHandler() {
@Override
public void onKeyDown(KeyDownEvent event) {
if (event.getNativeKeyCode() == KeyCodes.KEY_ENTER) {
if (validate(property,
textBox.getText())) {
textBox.clearOldValidationErrors();
property.setCurrentStringValue(textBox.getText());
propertyEditorChangeEventEvent.fire(new PropertyEditorChangeEvent(property,
textBox.getText()));
} else {
textBox.setValidationError(getValidatorErrorMessage(property,
textBox.getText()));
textBox.setText(property.getCurrentStringValue());
}
}
}
});
}
TextField.java 文件源码
java
阅读 21
收藏 0
点赞 0
评论 0
项目:appformer
作者:
评论列表
文章目录