Package com.vaadin.ui
Class AbstractField.FocusShortcut
- java.lang.Object
-
- com.vaadin.event.Action
-
- com.vaadin.event.ShortcutAction
-
- com.vaadin.event.ShortcutListener
-
- com.vaadin.ui.AbstractField.FocusShortcut
-
- All Implemented Interfaces:
Action.Listener
,Serializable
- Enclosing class:
- AbstractField<T>
public static class AbstractField.FocusShortcut extends ShortcutListener
A ready-madeShortcutListener
that focuses the givenComponent.Focusable
(usually aField
) when the keyboard shortcut is invoked.- 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 Component.Focusable
focusable
-
Fields inherited from class com.vaadin.event.ShortcutAction
SHORTHAND_CHAR_ALT, SHORTHAND_CHAR_CTRL, SHORTHAND_CHAR_SHIFT
-
-
Constructor Summary
Constructors Constructor Description FocusShortcut(Component.Focusable focusable, int keyCode)
Creates a keyboard shortcut for focusing the givenComponent.Focusable
.FocusShortcut(Component.Focusable focusable, int keyCode, int... modifiers)
Creates a keyboard shortcut for focusing the givenComponent.Focusable
.FocusShortcut(Component.Focusable focusable, String shorthandCaption)
Creates a keyboard shortcut for focusing the givenComponent.Focusable
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
-
focusable
protected Component.Focusable focusable
-
-
Constructor Detail
-
FocusShortcut
public FocusShortcut(Component.Focusable focusable, String shorthandCaption)
Creates a keyboard shortcut for focusing the givenComponent.Focusable
using the shorthand notation defined inShortcutAction
.- Parameters:
focusable
- to focused when the shortcut is invokedshorthandCaption
- caption with keycode and modifiers indicated
-
FocusShortcut
public FocusShortcut(Component.Focusable focusable, int keyCode, int... modifiers)
Creates a keyboard shortcut for focusing the givenComponent.Focusable
.- Parameters:
focusable
- to focused when the shortcut is invokedkeyCode
- keycode that invokes the shortcutmodifiers
- modifiers required to invoke the shortcut
-
FocusShortcut
public FocusShortcut(Component.Focusable focusable, int keyCode)
Creates a keyboard shortcut for focusing the givenComponent.Focusable
.- Parameters:
focusable
- to focused when the shortcut is invokedkeyCode
- keycode that invokes the shortcut
-
-
Method Detail
-
handleAction
public void handleAction(Object sender, Object target)
- Specified by:
handleAction
in interfaceAction.Listener
- Specified by:
handleAction
in classShortcutListener
-
-