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

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

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

org.netbeans.editor
Class MultiKeymap

java.lang.Object
  extended by org.netbeans.editor.MultiKeymap
All Implemented Interfaces:
Keymap

public class MultiKeymap
extends Object
implements Keymap

Keymap that is capable to work with MultiKeyBindings


Field Summary
static Action BEEP_ACTION
          Action that beeps.
static Action EMPTY_ACTION
          Action that does nothing
 
Constructor Summary
MultiKeymap(String name)
          Construct new keymap.
 
Method Summary
 void addActionForKeyStroke(KeyStroke key, Action a)
           
 Action getAction(KeyStroke key)
           
 Action[] getBoundActions()
           
 KeyStroke[] getBoundKeyStrokes()
           
 Action getDefaultAction()
          Get default action of this keymap or parent keymap if this one doesn't have one.
 KeyStroke[] getKeyStrokesForAction(Action a)
           
 String getName()
           
 Keymap getResolveParent()
           
 boolean isLocallyDefined(KeyStroke key)
           
 void load(JTextComponent.KeyBinding[] bindings, Action[] actions)
          Loads the key to action mappings into this keymap in similar way as JTextComponent.loadKeymap() does.
 void load(JTextComponent.KeyBinding[] bindings, Map actions)
          Loads key to action mappings into this keymap
 void removeBindings()
           
 void removeKeyStrokeBinding(KeyStroke key)
           
 void resetContext()
          Reset keymap to base context
 void setContextKeyNotFoundAction(Action a)
          What to do when key is not resolved for context
 void setDefaultAction(Action a)
           
 void setResolveParent(Keymap parent)
           
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

EMPTY_ACTION

public static final Action EMPTY_ACTION
Action that does nothing


BEEP_ACTION

public static final Action BEEP_ACTION
Action that beeps. Used for wrong shortcut by default

Constructor Detail

MultiKeymap

public MultiKeymap(String name)
Construct new keymap.

Parameters:
name - name of new keymap
Method Detail

resetContext

public void resetContext()
Reset keymap to base context


setContextKeyNotFoundAction

public void setContextKeyNotFoundAction(Action a)
What to do when key is not resolved for context


load

public void load(JTextComponent.KeyBinding[] bindings,
                 Action[] actions)
Loads the key to action mappings into this keymap in similar way as JTextComponent.loadKeymap() does. This method is able to handle MultiKeyBindings but for compatibility it expects JTextComponent.KeyBinding array.


load

public void load(JTextComponent.KeyBinding[] bindings,
                 Map actions)
Loads key to action mappings into this keymap

Parameters:
bindings - array of bindings
actions - map of [action_name, action] pairs

getName

public String getName()
Specified by:
getName in interface Keymap

getDefaultAction

public Action getDefaultAction()
Get default action of this keymap or parent keymap if this one doesn't have one. Context keymap can have default action but it will be not used.

Specified by:
getDefaultAction in interface Keymap

setDefaultAction

public void setDefaultAction(Action a)
Specified by:
setDefaultAction in interface Keymap

getAction

public Action getAction(KeyStroke key)
Specified by:
getAction in interface Keymap

getBoundKeyStrokes

public KeyStroke[] getBoundKeyStrokes()
Specified by:
getBoundKeyStrokes in interface Keymap

getBoundActions

public Action[] getBoundActions()
Specified by:
getBoundActions in interface Keymap

getKeyStrokesForAction

public KeyStroke[] getKeyStrokesForAction(Action a)
Specified by:
getKeyStrokesForAction in interface Keymap

isLocallyDefined

public boolean isLocallyDefined(KeyStroke key)
Specified by:
isLocallyDefined in interface Keymap

addActionForKeyStroke

public void addActionForKeyStroke(KeyStroke key,
                                  Action a)
Specified by:
addActionForKeyStroke in interface Keymap

removeKeyStrokeBinding

public void removeKeyStrokeBinding(KeyStroke key)
Specified by:
removeKeyStrokeBinding in interface Keymap

removeBindings

public void removeBindings()
Specified by:
removeBindings in interface Keymap

getResolveParent

public Keymap getResolveParent()
Specified by:
getResolveParent in interface Keymap

setResolveParent

public void setResolveParent(Keymap parent)
Specified by:
setResolveParent in interface Keymap

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.