Extension SDK 10.1.2

oracle.ide.keyboard
Class KeyStrokeMap

java.lang.Object
  extended byoracle.ide.keyboard.KeyStrokeMap
All Implemented Interfaces:
java.io.Serializable

public final class KeyStrokeMap
extends java.lang.Object
implements java.io.Serializable

The KeyStrokeMap maps Keystrokes to action binding objects.
KeyStrokeMap does not extend a real Map but implements most of the Map methods.

See Also:
Serialized Form

Constructor Summary
KeyStrokeMap()
           
 
Method Summary
 void assign(KeyStrokeMap source)
          Assing the content of source to this.
 KeyStrokeMap cloneObject()
          note: does not clone the listeners
 java.lang.Integer getBindingFor(KeyStrokes kss)
           
 java.util.ArrayList getData()
           
 java.util.List getKeyStrokesFor(int bind)
          Finds which KeyStrokes are mapped with the bind value.
 java.util.List getKeyStrokesFor(java.lang.Integer bind)
          Finds which KeyStrokes are mapped with the bind value.
 java.util.List getKeyStrokesStartingWith(KeyStrokes kss)
           
 java.util.Set keySet()
           
 void put(KeyStrokes key, java.lang.Integer bind)
          Add a mapping from an accelerator to a command
 void putAll(KeyStrokeMap ksm)
          Add all the mappings in ksm to this map.
 void remove(KeyStrokes key)
          Removes the mapping for this KeyStrokes
 void setData(java.util.ArrayList data)
           
 boolean solvePostponedLoad()
          Call this method if you want to postpone the definition of your local actions.
 java.util.Collection values()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

KeyStrokeMap

public KeyStrokeMap()
Method Detail

cloneObject

public KeyStrokeMap cloneObject()
note: does not clone the listeners


assign

public void assign(KeyStrokeMap source)
Assing the content of source to this.


put

public void put(KeyStrokes key,
                java.lang.Integer bind)
Add a mapping from an accelerator to a command

Parameters:
key - the accelerator
bind - the IdeAction.getCommandId()

putAll

public void putAll(KeyStrokeMap ksm)
Add all the mappings in ksm to this map.


remove

public void remove(KeyStrokes key)
Removes the mapping for this KeyStrokes


keySet

public java.util.Set keySet()
Returns:
a Set of KeyStrokes

values

public java.util.Collection values()
Returns:
a Collection of all the Integers used in the mappings

getKeyStrokesFor

public java.util.List getKeyStrokesFor(java.lang.Integer bind)
Finds which KeyStrokes are mapped with the bind value.

Parameters:
bind - the IdeAction.getCommandId() value
Returns:
a Set of KeyStrokes. If no KeyStrokes are bound to this value, and empty set is returned. The method never returns null

getKeyStrokesFor

public java.util.List getKeyStrokesFor(int bind)
Finds which KeyStrokes are mapped with the bind value.

Parameters:
bind - the IdeAction.getCommandId() value
Returns:
a Set of KeyStrokes. If no KeyStrokes are bound to this value, and empty set is returned. The method never returns null

getBindingFor

public java.lang.Integer getBindingFor(KeyStrokes kss)
Returns:
the object that binds the keystrokes and the action or null if no mapping exists

getKeyStrokesStartingWith

public java.util.List getKeyStrokesStartingWith(KeyStrokes kss)
Returns:
a List of KeyStrokes. If there is no mapping for this KeyStrokes, teh method returns an empty list. The method never returns null

getData

public java.util.ArrayList getData()

setData

public void setData(java.util.ArrayList data)
Parameters:
data - an ArrayList of Pair(String command, KeyStrokes key)

solvePostponedLoad

public boolean solvePostponedLoad()
Call this method if you want to postpone the definition of your local actions. You will have to create your actions and update call this method at 2 places: 1) before you create the MultiInputMap, 2) when you receive a message from the Ide. Ex: Ide.getSettings().getKeyStrokeOptions().getLocalKeyMap(keyStrokeContext).solvePostponedLoad();

Returns:
true if all commands have been solved

Extension SDK

 

Copyright © 1997, 2004, Oracle. All rights reserved.