Module is.codion.swing.common.ui
Package is.codion.swing.common.ui.key
Interface KeyboardShortcuts<T extends Enum<T> & KeyboardShortcuts.Shortcut>
- Type Parameters:
T
- the shortcut key type
public interface KeyboardShortcuts<T extends Enum<T> & KeyboardShortcuts.Shortcut>
Holds mutable keyboard shortcut keyStrokes, mapped to enum based shortcut keys.
- See Also:
-
Nested Class Summary
Modifier and TypeInterfaceDescriptionstatic interface
Specifies a keyboard shortcut providing a default key stroke. -
Method Summary
Modifier and TypeMethodDescriptioncopy()
static <T extends Enum<T> & KeyboardShortcuts.Shortcut>
KeyboardShortcuts<T>keyboardShortcuts
(Class<T> shortcutKeyClass) static KeyStroke
keyStroke
(int keyCode) Creates aKeyStroke
with the given keyCode and no modifiers.static KeyStroke
keyStroke
(int keyCode, int modifiers) Creates aKeyStroke
with the given keyCode and modifiers.
-
Method Details
-
keyStroke
- Parameters:
shortcut
- the shortcut key- Returns:
- the
Value
controlling the key stroke for the given shortcut key
-
copy
KeyboardShortcuts<T> copy()- Returns:
- a copy of this
KeyboardShortcuts
instance
-
keyboardShortcuts
static <T extends Enum<T> & KeyboardShortcuts.Shortcut> KeyboardShortcuts<T> keyboardShortcuts(Class<T> shortcutKeyClass) - Type Parameters:
T
- the shortcut key type- Parameters:
shortcutKeyClass
- the shortcut key class- Returns:
- a new
KeyboardShortcuts
instance - Throws:
IllegalArgumentException
- in case any of the shortcut keys is missing a default keystroke
-
keyStroke
Creates aKeyStroke
with the given keyCode and no modifiers.- Parameters:
keyCode
- the key code- Returns:
- a keystroke value
- See Also:
-
keyStroke
Creates aKeyStroke
with the given keyCode and modifiers.- Parameters:
keyCode
- the key codemodifiers
- the modifiers- Returns:
- a keystroke value
- See Also:
-