Module is.codion.swing.common.ui
Package is.codion.swing.common.ui.key
Interface KeyboardShortcuts<T extends Enum<T>>
- Type Parameters:
T- the shortcut key type
public interface KeyboardShortcuts<T extends Enum<T>>
Holds keyboard shortcut keyStrokes, mapped to enum based shortcut keys.
- See Also:
-
Method Summary
Modifier and TypeMethodDescriptioncopy()static <T extends Enum<T>>
KeyboardShortcuts<T>keyboardShortcuts(Class<T> shortcutKeyClass, Function<T, KeyStroke> defaultKeyStrokes) 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:
keyboardShortcut- 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<T> keyboardShortcuts(Class<T> shortcutKeyClass, Function<T, KeyStroke> defaultKeyStrokes) - Type Parameters:
T- the shortcut key type- Parameters:
shortcutKeyClass- the shortcut key classdefaultKeyStrokes- provides the default keystroke for each shortcut key- Returns:
- a new
KeyboardShortcutsinstance - Throws:
IllegalArgumentException- in case the default keyStrokes function does not provide keyStrokes for all shortcut keys
-
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:
-