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
Nested ClassesModifier and TypeInterfaceDescriptionstatic interfaceSpecifies 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 KeyStrokekeyStroke(int keyCode) Creates aKeyStrokewith the given keyCode and no modifiers.static KeyStrokekeyStroke(int keyCode, int modifiers) Creates aKeyStrokewith the given keyCode and modifiers.is.codion.common.value.Value<KeyStroke>
-
Method Details
-
keyStroke
- Parameters:
shortcut- the shortcut key- Returns:
- the
Valuecontrolling the key stroke for the given shortcut key
-
copy
KeyboardShortcuts<T> copy()- Returns:
- a copy of this
KeyboardShortcutsinstance
-
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
KeyboardShortcutsinstance - Throws:
IllegalArgumentException- in case any of the shortcut keys is missing a default keystroke
-
keyStroke
Creates aKeyStrokewith the given keyCode and no modifiers.- Parameters:
keyCode- the key code- Returns:
- a keystroke value
- See Also:
-
keyStroke
Creates aKeyStrokewith the given keyCode and modifiers.- Parameters:
keyCode- the key codemodifiers- the modifiers- Returns:
- a keystroke value
- See Also:
-