Package docking.action

# Class KeyBindingData

java.lang.Object
docking.action.KeyBindingData

public class KeyBindingData extends Object
An object that contains a key stroke and the precedence for when that key stroke should be used.

Note: this class creates key strokes that work on key `pressed`. This effectively normalizes all client key bindings to work on the same type of key stroke (pressed, typed or released).

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `KeyBindingData(char c, int modifiers)`
  `KeyBindingData(int keyCode, int modifiers)`
  `KeyBindingData(String keyStrokeString)`
  Creates a key stroke from the given text.
  `KeyBindingData(KeyStroke keyStroke)`
  `KeyBindingData(KeyStroke keyStroke, KeyBindingPrecedence precedence)`

- ## Method Summary

  Modifier and Type
  Method
  Description
  `KeyStroke`
  `getKeyBinding()`
  Returns an accelerator keystroke to be associated with this action.
  `KeyBindingPrecedence`
  `getKeyBindingPrecedence()`
  Returns the keyBindingPrecedence for this action
  `String`
  `toString()`
  `static KeyBindingData`
  `validateKeyBindingData(KeyBindingData newKeyBindingData)`
  Updates the given data with system-independent versions of key modifiers.

  ### Methods inherited from class java.lang.Object

  `clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

- ## Constructor Details

  - ### KeyBindingData

    public KeyBindingData(KeyStroke keyStroke)

  - ### KeyBindingData

    public KeyBindingData(char c, int modifiers)

  - ### KeyBindingData

    public KeyBindingData(int keyCode, int modifiers)

  - ### KeyBindingData

    public KeyBindingData(String keyStrokeString)
    Creates a key stroke from the given text. See `KeyBindingUtils.parseKeyStroke(KeyStroke)`. The key stroke created for this class will always be a key `pressed` key stroke.
    Parameters:
      `keyStrokeString` - the key stroke string to parse

  - ### KeyBindingData

    public KeyBindingData(KeyStroke keyStroke, KeyBindingPrecedence precedence)

- ## Method Details

  - ### getKeyBinding

    public KeyStroke getKeyBinding()
    Returns an accelerator keystroke to be associated with this action.
    Returns:
      the binding

  - ### getKeyBindingPrecedence

    public KeyBindingPrecedence getKeyBindingPrecedence()
    Returns the keyBindingPrecedence for this action
    Returns:
      the precedence

  - ### toString

    public String toString()
    Overrides:
      `toString` in class `Object`

  - ### validateKeyBindingData

    public static KeyBindingData validateKeyBindingData(KeyBindingData newKeyBindingData)
    Updates the given data with system-independent versions of key modifiers. For example, the `control` key will be converted to the `command` key on the Mac.
    Parameters:
      `newKeyBindingData` - the data to validate
    Returns:
      the potentially changed data