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 Details

    • keyStroke

      Value<KeyStroke> keyStroke(T keyboardShortcut)
      Parameters:
      keyboardShortcut - the shortcut key
      Returns:
      the Value controlling the key stroke for the given shortcut key
    • copy

      Returns:
      a copy of this KeyboardShortcuts instance
    • 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 class
      defaultKeyStrokes - provides the default keystroke for each shortcut key
      Returns:
      a new KeyboardShortcuts instance
      Throws:
      IllegalArgumentException - in case the default keyStrokes function does not provide keyStrokes for all shortcut keys
    • keyStroke

      static KeyStroke keyStroke(int keyCode)
      Creates a KeyStroke with the given keyCode and no modifiers.
      Parameters:
      keyCode - the key code
      Returns:
      a keystroke value
      See Also:
    • keyStroke

      static KeyStroke keyStroke(int keyCode, int modifiers)
      Creates a KeyStroke with the given keyCode and modifiers.
      Parameters:
      keyCode - the key code
      modifiers - the modifiers
      Returns:
      a keystroke value
      See Also: