com.vaadin.flow.component.
Class ShortcutEvent
All Implemented Interfaces:
Event when shortcut is detected.
Since:
1.3
Author:
Vaadin Ltd.
See Also:
-
Field Summary
Fields inherited from class java.util.EventObject
source
-
Constructor Summary
ConstructorsConstructorDescriptionShortcutEvent
(Component source, Component lifecycleOwner, Key key, Set<KeyModifier> keyModifiers) Creates a new
ShortcutEvent
. -
Method Summary
Modifier and TypeMethodDescriptiongetKey()
Primary
Key
that triggered the shortcut.Set of
KeyModifiers
that, in combination with the primary key, triggered the shortcut.Component which owns the shortcut.
Component which listened for the shortcut.
boolean
matches
(Key key, KeyModifier... keyModifiers) Checks if the event matches the given
Key
and (optional)KeyModifiers
.Methods inherited from class java.util.EventObject
toString
-
Constructor Details
-
ShortcutEvent
public ShortcutEvent(Component source, Component lifecycleOwner, Key key, Set<KeyModifier> keyModifiers) Creates a new
ShortcutEvent
.Parameters:
source
- shortcut'slistenOn
Component
lifecycleOwner
- shortcut'slifecycleOwner
Component
key
- primaryKey
of the shortcutkeyModifiers
- set ofKeyModifiers
of the shortcut
-
-
Method Details
-
getSource
Component which listened for the shortcut.
Overrides:
getSource
in classEventObject
Returns:
listening
Component
-
getLifecycleOwner
Component which owns the shortcut.
Returns:
owning
Component
-
getKey
Primary
Key
that triggered the shortcut. Primary key can be anything that is not aKeyModifier
.Returns:
primary key
-
getKeyModifiers
Set of
KeyModifiers
that, in combination with the primary key, triggered the shortcut.Returns:
set of key modifiers
-
matches
Checks if the event matches the given
Key
and (optional)KeyModifiers
. Ifkey
is null or a wrong number ofkeyModifiers
is given, returnsfalse
.Parameters:
key
-key
to comparekeyModifiers
-keyModifiers
to compareReturns:
Did the given parameters match those in the event?
-