public static class AbstractField.FocusShortcut extends ShortcutListener
ShortcutListener
that focuses the given
Focusable
(usually a Field
) when the keyboard shortcut is
invoked.ShortcutAction.KeyCode, ShortcutAction.ModifierKey
Action.Container, Action.Handler, Action.Listener, Action.Notifier, Action.ShortcutNotifier
Modifier and Type | Field and Description |
---|---|
protected Component.Focusable |
focusable |
SHORTHAND_CHAR_ALT, SHORTHAND_CHAR_CTRL, SHORTHAND_CHAR_SHIFT
Constructor and Description |
---|
FocusShortcut(Component.Focusable focusable,
int keyCode)
Creates a keyboard shortcut for focusing the given
Focusable . |
FocusShortcut(Component.Focusable focusable,
int keyCode,
int... modifiers)
Creates a keyboard shortcut for focusing the given
Focusable . |
FocusShortcut(Component.Focusable focusable,
String shorthandCaption)
Creates a keyboard shortcut for focusing the given
Focusable
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 Component.Focusable focusable
public FocusShortcut(Component.Focusable focusable, String shorthandCaption)
Focusable
using the shorthand notation defined in ShortcutAction
.focusable
- to focused when the shortcut is invokedshorthandCaption
- caption with keycode and modifiers indicatedpublic FocusShortcut(Component.Focusable focusable, int keyCode, int... modifiers)
Focusable
.focusable
- to focused when the shortcut is invokedkeyCode
- keycode that invokes the shortcutmodifiers
- modifiers required to invoke the shortcutpublic FocusShortcut(Component.Focusable focusable, int keyCode)
Focusable
.focusable
- to focused when the shortcut is invokedkeyCode
- keycode that invokes the shortcutpublic void handleAction(Object sender, Object target)
handleAction
in interface Action.Listener
handleAction
in class ShortcutListener
Copyright © 2019 Vaadin Ltd. All rights reserved.