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.Objectpublic java.lang.String getName()
KeyStrokeContextgetName in interface KeyStrokeContextpublic abstract java.util.Set getAllActions(boolean bGlobal)
KeyStrokeContextgetAllActions in interface KeyStrokeContextpublic final KeyStrokeMap getPresetKeyStrokeMap(java.lang.Object preset, boolean bGlobal)
KeyStrokeContextgetPresetKeyStrokeMap in interface KeyStrokeContextpreset - 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()
KeyStrokeContextThe values in the list should be one of the PC_ constants.
getAllPresets in interface KeyStrokeContextpublic java.lang.String getAcceleratorFile()
KeyStrokeContextgetAcceleratorFile in interface KeyStrokeContext