public static class Button.ClickShortcut extends ShortcutListener
ShortcutListener specifically made to define a keyboard
shortcut that invokes a click on the given button.ShortcutAction.KeyCode, ShortcutAction.ModifierKeyAction.Container, Action.Handler, Action.Listener, Action.Notifier, Action.ShortcutNotifier| Modifier and Type | Field and Description |
|---|---|
protected Button |
button |
SHORTHAND_CHAR_ALT, SHORTHAND_CHAR_CTRL, SHORTHAND_CHAR_SHIFT| Constructor and Description |
|---|
ClickShortcut(Button button,
int keyCode)
Creates a keyboard shortcut for clicking the given button using the
given
ShortcutAction.KeyCode. |
ClickShortcut(Button button,
int keyCode,
int... modifiers)
Creates a keyboard shortcut for clicking the given button using the
given
ShortcutAction.KeyCode and ShortcutAction.ModifierKeys. |
ClickShortcut(Button button,
String shorthandCaption)
Creates a keyboard shortcut for clicking the given button using the
shorthand notation defined in
ShortcutAction. |
| Modifier and Type | Method and Description |
|---|---|
void |
handleAction(Object sender,
Object target) |
getKeyCode, getModifiersgetCaption, getIcon, setCaption, setIconprotected Button button
public ClickShortcut(Button button, String shorthandCaption)
ShortcutAction.button - to be clicked when the shortcut is invokedshorthandCaption - the caption with shortcut keycode and modifiers indicatedpublic ClickShortcut(Button button, int keyCode, int... modifiers)
ShortcutAction.KeyCode and ShortcutAction.ModifierKeys.button - to be clicked when the shortcut is invokedkeyCode - KeyCode to react tomodifiers - optional modifiers for shortcutpublic ClickShortcut(Button button, int keyCode)
ShortcutAction.KeyCode.button - to be clicked when the shortcut is invokedkeyCode - KeyCode to react topublic void handleAction(Object sender, Object target)
handleAction in interface Action.ListenerhandleAction in class ShortcutListenerCopyright © 2022 Vaadin Ltd. All rights reserved.