Package com.vaadin.ui
Class Button.ClickShortcut
- java.lang.Object
-
- com.vaadin.event.Action
-
- com.vaadin.event.ShortcutAction
-
- com.vaadin.event.ShortcutListener
-
- com.vaadin.ui.Button.ClickShortcut
-
- All Implemented Interfaces:
Action.Listener
,Serializable
- Enclosing class:
- Button
public static class Button.ClickShortcut extends ShortcutListener
AShortcutListener
specifically made to define a keyboard shortcut that invokes a click on the given button.- See Also:
- Serialized Form
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class com.vaadin.event.ShortcutAction
ShortcutAction.KeyCode, ShortcutAction.ModifierKey
-
Nested classes/interfaces inherited from class com.vaadin.event.Action
Action.Container, Action.Handler, Action.Listener, Action.Notifier, Action.ShortcutNotifier
-
-
Field Summary
Fields Modifier and Type Field Description protected Button
button
-
Fields inherited from class com.vaadin.event.ShortcutAction
SHORTHAND_CHAR_ALT, SHORTHAND_CHAR_CTRL, SHORTHAND_CHAR_SHIFT
-
-
Constructor Summary
Constructors Constructor Description ClickShortcut(Button button, int keyCode)
Creates a keyboard shortcut for clicking the given button using the givenShortcutAction.KeyCode
.ClickShortcut(Button button, int keyCode, int... modifiers)
Creates a keyboard shortcut for clicking the given button using the givenShortcutAction.KeyCode
andShortcutAction.ModifierKey
s.ClickShortcut(Button button, String shorthandCaption)
Creates a keyboard shortcut for clicking the given button using the shorthand notation defined inShortcutAction
.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
handleAction(Object sender, Object target)
-
Methods inherited from class com.vaadin.event.ShortcutAction
getKeyCode, getModifiers
-
Methods inherited from class com.vaadin.event.Action
getCaption, getIcon, setCaption, setIcon
-
-
-
-
Field Detail
-
button
protected Button button
-
-
Constructor Detail
-
ClickShortcut
public ClickShortcut(Button button, String shorthandCaption)
Creates a keyboard shortcut for clicking the given button using the shorthand notation defined inShortcutAction
.- Parameters:
button
- to be clicked when the shortcut is invokedshorthandCaption
- the caption with shortcut keycode and modifiers indicated
-
ClickShortcut
public ClickShortcut(Button button, int keyCode, int... modifiers)
Creates a keyboard shortcut for clicking the given button using the givenShortcutAction.KeyCode
andShortcutAction.ModifierKey
s.- Parameters:
button
- to be clicked when the shortcut is invokedkeyCode
- KeyCode to react tomodifiers
- optional modifiers for shortcut
-
ClickShortcut
public ClickShortcut(Button button, int keyCode)
Creates a keyboard shortcut for clicking the given button using the givenShortcutAction.KeyCode
.- Parameters:
button
- to be clicked when the shortcut is invokedkeyCode
- KeyCode to react to
-
-
Method Detail
-
handleAction
public void handleAction(Object sender, Object target)
- Specified by:
handleAction
in interfaceAction.Listener
- Specified by:
handleAction
in classShortcutListener
-
-