站内搜索: 请输入搜索关键词
当前页面: 在线文档首页 > NetBeans API Javadoc (Current Development Version)

MultiKeyBinding (Editor Library) - NetBeans API Javadoc (Current Development Version)

org.netbeans.modules.editor.lib/1 1.14.0 3

org.netbeans.editor
Class MultiKeyBinding

java.lang.Object
  extended by javax.swing.text.JTextComponent.KeyBinding
      extended by org.netbeans.editor.MultiKeyBinding
All Implemented Interfaces:
Externalizable, Serializable

public class MultiKeyBinding
extends JTextComponent.KeyBinding
implements Externalizable

Extension of JTextComponent.KeyBinding to hold several successive keystrokes. The binding containing null key(s) is assumed to assign the default action.

See Also:
Serialized Form

Field Summary
 KeyStroke[] keys
          Successive keystroke.
 
Fields inherited from class javax.swing.text.JTextComponent.KeyBinding
actionName, key
 
Constructor Summary
MultiKeyBinding()
          Constructor for serialization
MultiKeyBinding(JTextComponent.KeyBinding kb)
          Constructor for existing KeyBinding
MultiKeyBinding(KeyStroke[] keys, String actionName)
          Constructor for assigning keystroke sequence to action
MultiKeyBinding(KeyStroke key, String actionName)
          Compatibility constructor
 
Method Summary
 boolean equals(Object o)
           
 void readExternal(ObjectInput in)
           
 String toString()
           
static void updateKeyBindings(JTextComponent.KeyBinding[] target, JTextComponent.KeyBinding[] changes)
          Add or replace key bindings array by changes given in the second bindings array
 void writeExternal(ObjectOutput out)
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

keys

public KeyStroke[] keys
Successive keystroke. They must be pressed in the order they are stored in the array in order to invoke the associated action.

Constructor Detail

MultiKeyBinding

public MultiKeyBinding()
Constructor for serialization


MultiKeyBinding

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

Parameters:
keys - successive keystroke that must be pressed in order to invoke action
actionName - action that will be invoked. Action is resolved from name by calling kit.getActions() after the kit is constructed

MultiKeyBinding

public MultiKeyBinding(KeyStroke key,
                       String actionName)
Compatibility constructor


MultiKeyBinding

public MultiKeyBinding(JTextComponent.KeyBinding kb)
Constructor for existing KeyBinding

Method Detail

equals

public boolean equals(Object o)
Overrides:
equals in class Object

updateKeyBindings

public static void updateKeyBindings(JTextComponent.KeyBinding[] target,
                                     JTextComponent.KeyBinding[] changes)
Add or replace key bindings array by changes given in the second bindings array

Parameters:
target - target list of bindings
changes - list of changes to apply: binding containing the non-null keystroke(s) and non-null action will add the binding or replace the old binding with the same keystroke(s) in the target array, binding of the non-null keystroke(s) and null action removes the binding for that keystroke from the target array (if it existed) binding containing null keystroke and non-null action adds or replaces default action

readExternal

public void readExternal(ObjectInput in)
                  throws IOException,
                         ClassNotFoundException
Specified by:
readExternal in interface Externalizable
Throws:
IOException
ClassNotFoundException

writeExternal

public void writeExternal(ObjectOutput out)
                   throws IOException
Specified by:
writeExternal in interface Externalizable
Throws:
IOException

toString

public String toString()
Overrides:
toString in class Object

org.netbeans.modules.editor.lib/1 1.14.0 3

Built on May 28 2007.  |  Portions Copyright 1997-2007 Sun Microsystems, Inc. All rights reserved.