|
Extension SDK | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectoracle.ide.keyboard.DefaultKeyStrokeContext
This class implements the most common behavior of a KeyStrokeContext. The add/removeSubContext mechanism allows components to attach their context to another. For example, if the code editor exposes his DefaultKeyStrokeContext instance, addins that are specific to the code editor can add their context and the local accelerators will be used by the code editor. Additionally, they will appear in the code editor configuration panel.
Constructor Summary | |
DefaultKeyStrokeContext()
|
Method Summary | |
protected void |
addGlobalKeyStrokes(KeyStrokeMap map)
Overwrite this method to define your global keystrokes. |
protected void |
addLocalKeyStrokes(KeyStrokeMap map)
Overwrite this method to define your global keystrokes The codes is similar to addGlobalKeyStrokes. |
void |
addSubContext(KeyStrokeContext ksc)
Attach the sub-context ksc to this one. |
protected static void |
addToMap(KeyStrokeMap map,
int nId,
javax.swing.KeyStroke ks)
Helper method for filling the KeyStrokeMaps in addGlobal/LocalKeyStrokes. |
protected static void |
addToMap(KeyStrokeMap map,
int nId,
KeyStrokes kss)
Helper method for filling the KeyStrokeMaps in addGlobal/LocalKeyStrokes. |
java.util.List |
getAllPresets()
By default, DefaultKeyStrokeContexts only have a default preset. |
KeyStrokesConstraint |
getKeyStrokeConstraint()
By default, mappings of a DefaultKeyStrokeContexts have a text editor constraint. |
java.lang.String |
getName()
Get the name of this context as it will appear in the shortcut configuration panel. |
KeyStrokeMap |
getPresetKeyStrokeMap(java.lang.Object preset,
boolean bGlobal)
Returns the mapping between KeyStrokes and Actions. |
static boolean |
hasConfigPanel()
Most contexts only hold global keys and those are editable in the global panel. |
void |
removeSubContext(KeyStrokeContext ksc)
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface oracle.ide.keyboard.KeyStrokeContext |
getAllActions |
Constructor Detail |
public DefaultKeyStrokeContext()
Method Detail |
public java.lang.String getName()
KeyStrokeContext
getName
in interface KeyStrokeContext
public static boolean hasConfigPanel()
public final void addSubContext(KeyStrokeContext ksc)
public final void removeSubContext(KeyStrokeContext ksc)
public final KeyStrokeMap getPresetKeyStrokeMap(java.lang.Object preset, boolean bGlobal)
KeyStrokeContext
getPresetKeyStrokeMap
in interface KeyStrokeContext
preset
- corresponds to one of the elements returned by
getPresetKeyStrokeMaps or null to get the default map.bGlobal
- true when asked for the global keys.public final java.util.List getAllPresets()
getAllPresets
in interface KeyStrokeContext
public final KeyStrokesConstraint getKeyStrokeConstraint()
getKeyStrokeConstraint
in interface KeyStrokeContext
protected void addGlobalKeyStrokes(KeyStrokeMap map)
addToMap(map, Xxx.YYY_CMD_ID, XxxArb.getAccelerator(XxxArb.YYY_ACCELERATOR))
protected void addLocalKeyStrokes(KeyStrokeMap map)
addGlobalKeyStrokes(oracle.ide.keyboard.KeyStrokeMap)
protected static void addToMap(KeyStrokeMap map, int nId, javax.swing.KeyStroke ks)
map
- the KeyStrokeMap to fill.nId
- the command ID.ks
- the keystroke associated with the command ID.#addGlobalKeyStrokes, #addLocalKeyStrokes
protected static void addToMap(KeyStrokeMap map, int nId, KeyStrokes kss)
map
- the KeyStrokeMap to fill.nId
- the command ID.kss
- the multi-keystroke associated with the command ID.#addGlobalKeyStrokes, #addLocalKeyStrokes
|
Extension SDK | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Copyright ©1997, 2003, Oracle. All rights reserved.