use of com.vaadin.event.Action.Notifier in project SORMAS-Project by hzi-braunschweig.
the class CommitDiscardWrapperComponent method setShortcutsEnabled.
/**
* Whether the buttons can be operated by ENTER and ESC
*
* @param shortcutsEnabled
*/
public void setShortcutsEnabled(boolean shortcutsEnabled) {
if (shortcutsEnabled == this.shortcutsEnabled) {
if (!shortcutsEnabled || actions != null)
return;
}
this.shortcutsEnabled = shortcutsEnabled;
if (actions == null) {
actions = new ArrayList<>();
}
Collection<Notifier> notifiers = Arrays.asList((Notifier) contentPanel);
if (shortcutsEnabled) {
for (Notifier notifier : notifiers) {
registerActions(notifier);
}
} else {
for (ClickShortcut action : actions) {
action.remove();
}
actions.clear();
}
}
Aggregations