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.ModifierKey
Action.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.ModifierKey s. |
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, getModifiers
getCaption, getIcon, setCaption, setIcon
protected 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.ModifierKey
s.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.Listener
handleAction
in class ShortcutListener
Copyright © 2019 Vaadin Ltd. All rights reserved.