use of com.vaadin.event.FieldEvents.BlurListener in project opencms-core by alkacon.
the class CmsMessageBundleEditorOptions method initAddKeyInput.
/**
* Initializes the input field for new keys {@link #m_addKeyInput}.
*/
private void initAddKeyInput() {
// the input field for the key
m_addKeyInput = new TextField();
m_addKeyInput.setWidth("100%");
m_addKeyInput.setInputPrompt(m_messages.key(Messages.GUI_INPUT_PROMPT_ADD_KEY_0));
final ShortcutListener shortCutListener = new ShortcutListener("Add key via ENTER", KeyCode.ENTER, null) {
private static final long serialVersionUID = 1L;
@Override
public void handleAction(Object sender, Object target) {
handleAddKey();
}
};
m_addKeyInput.addFocusListener(new FocusListener() {
private static final long serialVersionUID = 1L;
public void focus(FocusEvent event) {
m_addKeyInput.addShortcutListener(shortCutListener);
}
});
m_addKeyInput.addBlurListener(new BlurListener() {
private static final long serialVersionUID = 1L;
public void blur(BlurEvent event) {
m_addKeyInput.removeShortcutListener(shortCutListener);
}
});
}
Aggregations