|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--com.borland.primetime.editor.DefaultKeymap | +--com.borland.primetime.editor.TrackingKeymap
This is a special subclass of DefaultKeymap which wraps retrieved Actions with a special TrackingAction. The TrackingAction is used to store the last action performed on an EditorPane. This class is also used to keep track of action/keyStroke modifiers which allows the actions of the keymap to be mapped to user defined keyStrokes.
javax.swing.text.JTextComponent.DefaultKeymap
Inner Class Summary | |
protected class |
TrackingKeymap.ActionModifier
Helper class to keep track of user defined modifications to the keymap. |
static class |
TrackingKeymap.TrackingAction
Helper class that wraps an action/keyStroke combination. |
Field Summary | |
protected java.util.ArrayList |
actionModifiers
The list of modifiers to action/keyStroke pairs. |
protected boolean |
modifiersApplied
We only apply the modifiers on a fresh keymap. |
Fields inherited from class com.borland.primetime.editor.DefaultKeymap |
bindings, defaultAction, master, nm, parent |
Constructor Summary | |
TrackingKeymap(java.lang.String nm,
javax.swing.text.Keymap parent)
Create a normal Tracking keymap |
Method Summary | |
boolean |
actionIsModified(javax.swing.Action action,
javax.swing.KeyStroke keyStroke)
Determine if the incoming action and keystroke pair is a combination that is not present in the original, unmodified keymap. |
void |
addSubKeymap(javax.swing.text.Keymap subKeymap)
Add a subKeymap, meaning that we are considered the master of this subKeymap. |
void |
applyActionModifiers()
After loading up a keymap, the action modifiers stored in the user.properties file have to be applied to the keymap. |
void |
applyOneActionModifier(javax.swing.Action action,
javax.swing.KeyStroke keyStroke,
boolean add)
Given an action and a keyStroke, either add it to the current keymap, or delete it from the keymap. |
void |
cancelActionModifiers()
Cancel any action modifiers that the keymap editor created. |
javax.swing.Action |
getAction(javax.swing.KeyStroke key)
Get the action in this keymap that is linked to the incoming keyStroke. |
javax.swing.Action |
getDefaultAction()
Fetch the default action to fire if a key is typed (ie a KEY_TYPED KeyEvent is received) and there is no binding for it. |
javax.swing.text.Keymap[] |
getSubKeymaps()
Return an array of our subKeymaps. |
void |
resetActionModifiers()
Cancel any action modifiers that the keymap editor created, and also cancel any action modifiers saved on disk. |
void |
saveActionModifiers()
Save the current list of action modifiers to the user.properties file. |
Methods inherited from class com.borland.primetime.editor.DefaultKeymap |
addActionForKeyStroke, getBindings, getBoundActions, getBoundKeyStrokes, getKeyStrokesForAction, getMaster, getName, getResolveParent, isLocallyDefined, removeBindings, removeKeyStrokeBinding, setBindings, setDefaultAction, setMaster, setResolveParent, toString |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
protected java.util.ArrayList actionModifiers
protected boolean modifiersApplied
Constructor Detail |
public TrackingKeymap(java.lang.String nm, javax.swing.text.Keymap parent)
nm
- The name of the keymapparent
- The optional parent of this keymapMethod Detail |
public javax.swing.Action getDefaultAction()
getDefaultAction
in class DefaultKeymap
public javax.swing.Action getAction(javax.swing.KeyStroke key)
getAction
in class DefaultKeymap
key
- The keyStroke we are interested inpublic void addSubKeymap(javax.swing.text.Keymap subKeymap)
subKeymap
- The keymap that considers this
keymap their master keymappublic javax.swing.text.Keymap[] getSubKeymaps()
public void saveActionModifiers()
public void applyActionModifiers()
public void applyOneActionModifier(javax.swing.Action action, javax.swing.KeyStroke keyStroke, boolean add)
action
- The action we are interested inkeyStroke
- The keystroke we are interested inadd
- If true we want to tie the keystroke to the
action, otherwise we want to delete the tie
of the keystroke and the actionpublic void cancelActionModifiers()
public void resetActionModifiers()
public boolean actionIsModified(javax.swing.Action action, javax.swing.KeyStroke keyStroke)
action
- The action we're interested in.keyStroke
- The keystroke we're interested in.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |