Package docking.actions

# Class KeyBindings

java.lang.Object
docking.actions.KeyBindings

public class KeyBindings extends Object
An object that maps actions to key strokes and mouse bindings.

This class knows how to load all system actions and how to load any key and mouse bindings for those actions from the tool's options. Clients can make changes to the state of this class that can then be applied to the system by calling `applyChanges()`.

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `KeyBindings(Tool tool)`

- ## Method Summary

  Modifier and Type
  Method
  Description
  `void`
  `applyChanges()`
  Applies any pending changes.
  `void`
  `cancelChanges()`
  Cancels any pending changes that have not yet been applied.
  `boolean`
  `containsAction(String fullName)`
  `String`
  `getActionForMouseBinding(MouseBinding mouseBinding)`
  `String`
  `getActionsForKeyStrokeText(KeyStroke keyStroke)`
  `KeyStroke`
  `getKeyStroke(String fullName)`
  `Map<String,KeyStroke>`
  `getKeyStrokesByFullActionName()`
  `String`
  `getLongestActionName()`
  `MouseBinding`
  `getMouseBinding(String fullName)`
  `List<DockingActionIf>`
  `getUniqueActions()`
  `boolean`
  `isMouseBindingInUse(String fullName, MouseBinding newBinding)`
  `boolean`
  `removeKeyStroke(String fullName)`
  `void`
  `restoreOptions()`
  Restores the tool options key bindings to the default values originally loaded when the system started.
  `boolean`
  `setActionKeyStroke(String fullName, KeyStroke newKs)`
  `boolean`
  `setActionMouseBinding(String fullName, MouseBinding newBinding)`

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

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

- ## Constructor Details

  - ### KeyBindings

    public KeyBindings(Tool tool)

- ## Method Details

  - ### getUniqueActions

    public List<DockingActionIf> getUniqueActions()

  - ### getKeyStrokesByFullActionName

    public Map<String,KeyStroke> getKeyStrokesByFullActionName()

  - ### containsAction

    public boolean containsAction(String fullName)

  - ### getKeyStroke

    public KeyStroke getKeyStroke(String fullName)

  - ### getMouseBinding

    public MouseBinding getMouseBinding(String fullName)

  - ### getActionForMouseBinding

    public String getActionForMouseBinding(MouseBinding mouseBinding)

  - ### getActionsForKeyStrokeText

    public String getActionsForKeyStrokeText(KeyStroke keyStroke)

  - ### getLongestActionName

    public String getLongestActionName()

  - ### isMouseBindingInUse

    public boolean isMouseBindingInUse(String fullName, MouseBinding newBinding)

  - ### setActionMouseBinding

    public boolean setActionMouseBinding(String fullName, MouseBinding newBinding)

  - ### setActionKeyStroke

    public boolean setActionKeyStroke(String fullName, KeyStroke newKs)

  - ### removeKeyStroke

    public boolean removeKeyStroke(String fullName)

  - ### restoreOptions

    public void restoreOptions()
    Restores the tool options key bindings to the default values originally loaded when the system started.

  - ### cancelChanges

    public void cancelChanges()
    Cancels any pending changes that have not yet been applied.

  - ### applyChanges

    public void applyChanges()
    Applies any pending changes.