public abstract class XMLKeyStrokeContext extends java.lang.Object implements KeyStrokeContext
Example:
public class MyKeys extends XMLKeyStrokeContext { MyKeys() { super("MyContext"); } public Set getAllActions(boolean bGlobal) { HashSet set = null; if (bGlobal) { set = new HashSet(); IdeAction action1 = MyController. ...; IdeAction action2 = MyController. ...; set.add(myAction1); set.add(myAction2); } return set; } public static void register() { MyKeys myKeys = new MyKeys(); KeyStrokeContextRegistry kscr = Ide.getKeyStrokeContextRegistry(); kscr.addContext(tks); } }
Constructor and Description |
---|
XMLKeyStrokeContext(java.lang.String sName) |
Modifier and Type | Method and Description |
---|---|
java.lang.String |
getAcceleratorFile()
If your addin provides predefined accelerator definitions, you should return the name of the .KDF file in your
jar file.
|
abstract java.util.Set |
getAllActions(boolean bGlobal)
Returns a Set of actions valid for the context.
|
java.util.List |
getAllPresets()
This method is called to get a list of the predefined mappings.
|
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.
|
java.lang.String |
toString() |
public java.lang.String toString()
toString
in class java.lang.Object
public java.lang.String getName()
KeyStrokeContext
getName
in interface KeyStrokeContext
public abstract java.util.Set getAllActions(boolean bGlobal)
KeyStrokeContext
getAllActions
in interface KeyStrokeContext
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()
KeyStrokeContext
The values in the list should be one of the PC_ constants.
getAllPresets
in interface KeyStrokeContext
public java.lang.String getAcceleratorFile()
KeyStrokeContext
getAcceleratorFile
in interface KeyStrokeContext