|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--com.borland.primetime.ide.KeymapManager
The KeymapManager is responsible for mapping keystrokes to actions for individual components. There is only one instance of the KeymapManager in the entire system.
Inner Class Summary | |
static class |
KeymapManager.KeyActionBinding
Binding record for creating bindings from KeyStrokes to Actions objects |
static class |
KeymapManager.KeyBinding
Binding record for creating bindings from KeyStrokes to Action Names. |
static class |
KeymapManager.SubKeymapAction
The purpose of this class is to wrap an Action object that happens to be bound in a sub keymap. |
protected static class |
KeymapManager.UpdateTimer
|
Field Summary | |
protected static KeymapManager.UpdateTimer |
updateTimer
|
Constructor Summary | |
KeymapManager()
|
Method Summary | |
static javax.swing.text.Keymap |
createKeymap(java.lang.String keymapName)
Create an empty Keymap. |
static javax.swing.text.Keymap |
createKeymap(java.lang.String keymapName,
KeymapManager.KeyActionBinding[] bindings)
Create a Keymap and fill it based on an array of KeyActionBinding objects. |
static javax.swing.text.Keymap |
createSubKeymap(java.lang.String keymapName,
javax.swing.text.Keymap masterMap,
KeymapManager.KeyActionBinding[] bindings)
Create a Keymap and fill it based on an array of KeyActionBinding objects. |
static javax.swing.text.Keymap |
getKeymap(java.lang.String keymapName)
Retrieves a registered Keymap. |
static javax.swing.KeyStroke[] |
getKeyStrokesForAction(javax.swing.Action a)
|
static java.lang.String[] |
getRegisteredKeymapNames()
Returns an array of the names of the registered Keymaps. |
static boolean |
installRegisteredKeymap(javax.swing.JComponent target,
java.lang.String keymapName)
Sets the Keymap to use for binding events to actions for a particular target. |
static boolean |
installRegisteredKeymap(javax.swing.JFrame target,
java.lang.String keymapName)
Sets the Keymap to use for binding events to actions for a particular target. |
static void |
loadKeymap(javax.swing.text.Keymap map,
KeymapManager.KeyActionBinding[] bindings)
Loads a Keymap with a bunch of bindings. |
static void |
loadKeymap(javax.swing.text.Keymap map,
KeymapManager.KeyBinding[] bindings,
javax.swing.Action[] actions)
Loads a Keymap with a bunch of bindings. |
static void |
loadSubKeymap(javax.swing.text.Keymap map,
javax.swing.text.Keymap masterMap,
KeymapManager.KeyActionBinding[] bindings)
Loads a Keymap with a bunch of bindings. |
static void |
loadSubKeymap(javax.swing.text.Keymap map,
javax.swing.text.Keymap masterMap,
KeymapManager.KeyBinding[] bindings,
javax.swing.Action[] actions)
Loads a Keymap with a bunch of bindings. |
static void |
registerKeymap(javax.swing.text.Keymap keymap)
Registers a Keymap with the KeymapManager. |
static void |
registerKeymap(javax.swing.text.Keymap keymap,
boolean topLevel)
Registers a Keymap with the KeymapManager. |
static void |
setKeymap(javax.swing.JComponent target,
javax.swing.text.Keymap map)
Sets the Keymap to use for binding events to actions for a particular target. |
Methods inherited from class java.lang.Object |
clone,
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
toString,
wait,
wait,
wait |
Field Detail |
protected static KeymapManager.UpdateTimer updateTimer
Constructor Detail |
public KeymapManager()
Method Detail |
public static void registerKeymap(javax.swing.text.Keymap keymap)
keymap
- The Keymap.KeymapManager#getRegisteredKeymap
public static void registerKeymap(javax.swing.text.Keymap keymap, boolean topLevel)
keymap
- The KeymaptopLevel
- True if this is a top level keymap (e.g. "Emacs"), false
if it is a mode of another keymap, (e.g. "Emacs_CX").KeymapManager#getRegisteredKeymap
public static javax.swing.text.Keymap getKeymap(java.lang.String keymapName)
keymapName
- The key used to store and retrieve the Keymap.registerKeymap(javax.swing.text.Keymap)
public static java.lang.String[] getRegisteredKeymapNames()
public static boolean installRegisteredKeymap(javax.swing.JComponent target, java.lang.String keymapName)
target
- the JComponent for which to set the KeymapkeymapName
- The key used to store and retrieve the Keymap.getKeymap(java.lang.String)
public static boolean installRegisteredKeymap(javax.swing.JFrame target, java.lang.String keymapName)
target
- the JFrame for which to set the KeymapkeymapName
- The key used to store and retrieve the Keymap.getKeymap(java.lang.String)
public static void setKeymap(javax.swing.JComponent target, javax.swing.text.Keymap map)
target
- the component for which to set the Keymapmap
- the KeymapgetKeymap(java.lang.String)
public static void loadKeymap(javax.swing.text.Keymap map, KeymapManager.KeyBinding[] bindings, javax.swing.Action[] actions)
This method does not clear the Keymap, so it can be used to add additional bindings to a Keymap which has already been loaded.
Note that this is here so that we don't have to directly deal with JTextComponent, even though we delegate to JTextComponent to do all the work.
map
- the Keymapbindings
- the bindingsactions
- the actionspublic static void loadSubKeymap(javax.swing.text.Keymap map, javax.swing.text.Keymap masterMap, KeymapManager.KeyBinding[] bindings, javax.swing.Action[] actions)
This method does not clear the Keymap, so it can be used to add additional bindings to a Keymap which has already been loaded.
This method is intended for keymaps that describe a subset of a major keymap (e.g. the Emacs "C-X" bindings are a subset of the Emacs keymap).
map
- the KeymapmasterMap
- the master Keymap which should be restored after executing
an action from the subkeymap.bindings
- the bindingsactions
- the actionspublic static void loadKeymap(javax.swing.text.Keymap map, KeymapManager.KeyActionBinding[] bindings)
This method does not clear the Keymap, so it can be used to add additional bindings to a Keymap which has already been loaded.
map
- the Keymapbindings
- the bindingspublic static void loadSubKeymap(javax.swing.text.Keymap map, javax.swing.text.Keymap masterMap, KeymapManager.KeyActionBinding[] bindings)
This method does not clear the Keymap, so it can be used to add additional bindings to a Keymap which has already been loaded.
This method is intended for keymaps that describe a subset of a major keymap (e.g. the Emacs "C-X" bindings are a subset of the Emacs keymap).
map
- the KeymapmasterMap
- the master Keymap which should be restored after executing
an action from the subkeymap.bindings
- the bindingspublic static javax.swing.text.Keymap createKeymap(java.lang.String keymapName, KeymapManager.KeyActionBinding[] bindings)
keymapName
- The name to be used to identify the Keymap.bindings
- An array of KeyActionBinding objects that will be used to
populate the Keymap.public static javax.swing.text.Keymap createSubKeymap(java.lang.String keymapName, javax.swing.text.Keymap masterMap, KeymapManager.KeyActionBinding[] bindings)
keymapName
- The name to be used to identify the Keymap.masterMap
- the master Keymap which should be restored after executing
an action from the subkeymap.bindings
- An array of KeyActionBinding objects that will be used to
populate the Keymap.public static javax.swing.text.Keymap createKeymap(java.lang.String keymapName)
keymapName
- The name to be used to identify the Keymap.public static javax.swing.KeyStroke[] getKeyStrokesForAction(javax.swing.Action a)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |