org.netbeans.modules.editor.settings/1 1.4.22

org.netbeans.api.editor.settings
Class MultiKeyBinding

java.lang.Object
  extended by org.netbeans.api.editor.settings.MultiKeyBinding

public final class MultiKeyBinding
extends Object

Variant of JTextComponent.KeyBinding to hold several successive keystrokes.


Constructor Summary
MultiKeyBinding(KeyStroke[] keyStrokes, String actionName)
          Constructor for assigning keystroke sequence to action
MultiKeyBinding(KeyStroke keyStroke, String actionName)
          Constructor for array single keystroke to action assignment.
 
Method Summary
 boolean equals(Object o)
          Two keybindings are equal if and only if they represent the same keystrokes sequence and the same action name.
 String getActionName()
          Get the name of the action which this keybinding triggers.
 KeyStroke getKeyStroke(int index)
          Get the key of this keybinding at the given index of the keystroke sequence.
 int getKeyStrokeCount()
          Get total number of keystrokes contained in this keybinding sequence.
 List getKeyStrokeList()
          Get list of keystrokes represented by this keybinding.
 int hashCode()
           
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

MultiKeyBinding

public MultiKeyBinding(KeyStroke[] keyStrokes,
                       String actionName)
Constructor for assigning keystroke sequence to action

Parameters:
keyStrokeList - non-null successive keystrokes that must be pressed in order to invoke action. The passed array must not be modified by the caller.
actionName - non-null name of the action that will be invoked.

MultiKeyBinding

public MultiKeyBinding(KeyStroke keyStroke,
                       String actionName)
Constructor for array single keystroke to action assignment.

Method Detail

getKeyStroke

public KeyStroke getKeyStroke(int index)
Get the key of this keybinding at the given index of the keystroke sequence.

Parameters:
index - >=0 and <getKeyStrokeCount() index.
Returns:
keystroke at the given index.
See Also:
getKeyStrokeCount()

getKeyStrokeCount

public int getKeyStrokeCount()
Get total number of keystrokes contained in this keybinding sequence.

Returns:
>=0 total count of keystrokes.

getKeyStrokeList

public List getKeyStrokeList()
Get list of keystrokes represented by this keybinding.

Returns:
non-null unmodifiable list of the keystrokes.

getActionName

public String getActionName()
Get the name of the action which this keybinding triggers.

Returns:
action non-null name of the action triggered by the sequence of the keystrokes contained in this keybinding.

equals

public boolean equals(Object o)
Two keybindings are equal if and only if they represent the same keystrokes sequence and the same action name.

Overrides:
equals in class Object

hashCode

public int hashCode()
Overrides:
hashCode in class Object

toString

public String toString()
Overrides:
toString in class Object

org.netbeans.modules.editor.settings/1 1.4.22

Built on July 11 2007.  |  Portions Copyright 1997-2005 Sun Microsystems, Inc. All rights reserved.