|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--com.borland.primetime.editor.DefaultKeymap
This is simply an implementation of the Keymap interface. It comes directly from JTextComponent.DefaultKeymap, which the Swing team neglected to make public. Sigh.
javax.swing.text.JTextComponent.DefaultKeymap
Field Summary | |
protected java.util.Hashtable |
bindings
The place where the key stroke / action pairs are stored. |
protected javax.swing.Action |
defaultAction
The default action of this keymap. |
protected javax.swing.text.Keymap |
master
The keymap that is the master of this keymap, which makes this keymap a sub keymap |
protected java.lang.String |
nm
The name of this keymap |
protected javax.swing.text.Keymap |
parent
The first parent in the parent hierarchy of this keymap. |
Constructor Summary | |
DefaultKeymap(java.lang.String nm,
javax.swing.text.Keymap parent)
Instantiate a new keymap with a name and a parent. |
Method Summary | |
void |
addActionForKeyStroke(javax.swing.KeyStroke key,
javax.swing.Action a)
Add a binding of a key stroke to an action in this keymap. |
javax.swing.Action |
getAction(javax.swing.KeyStroke key)
Get the action associated with the given key stroke. |
java.util.Hashtable |
getBindings()
Get the table of bindings of key strokes for this keymap. |
javax.swing.Action[] |
getBoundActions()
Get an array of actions that are bound to key strokes. |
javax.swing.KeyStroke[] |
getBoundKeyStrokes()
Get an array of key strokes that have actions associated with them. |
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.KeyStroke[] |
getKeyStrokesForAction(javax.swing.Action a)
Given an action, find all the key strokes that are bound to this action. |
javax.swing.text.Keymap |
getMaster()
Get the master of this keymap if any. |
java.lang.String |
getName()
Get the name of this keymap, which is the name used when this keymap was instantiated. |
javax.swing.text.Keymap |
getResolveParent()
Get the first parent up the parent hierarchy. |
boolean |
isLocallyDefined(javax.swing.KeyStroke key)
Determine if a key stroke is bound to an action in this keymap |
void |
removeBindings()
Remove all bindings of key strokes from this keymap. |
void |
removeKeyStrokeBinding(javax.swing.KeyStroke key)
Remove the binding of a key stroke from this keymap. |
void |
setBindings(java.util.Hashtable newBindings)
Set the table of bindings of key strokes for this keymap. |
void |
setDefaultAction(javax.swing.Action a)
Set the default action to fire if a key is typed. |
void |
setMaster(javax.swing.text.Keymap master)
Set the master of this keymap, and by doing that, make this keymap a sub keymap. |
void |
setResolveParent(javax.swing.text.Keymap parent)
Set the first parent in the parent hierarchy. |
java.lang.String |
toString()
String representation of the keymap... |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
protected java.lang.String nm
protected javax.swing.text.Keymap parent
protected java.util.Hashtable bindings
protected javax.swing.Action defaultAction
protected javax.swing.text.Keymap master
Constructor Detail |
public DefaultKeymap(java.lang.String nm, javax.swing.text.Keymap parent)
Method Detail |
public javax.swing.Action getDefaultAction()
getDefaultAction
in interface javax.swing.text.Keymap
public void setDefaultAction(javax.swing.Action a)
setDefaultAction
in interface javax.swing.text.Keymap
a
- the action that will become the default action
of this keymap.public java.lang.String getName()
getName
in interface javax.swing.text.Keymap
public javax.swing.Action getAction(javax.swing.KeyStroke key)
getAction
in interface javax.swing.text.Keymap
key
- the key stroke which should trigger an action.public javax.swing.KeyStroke[] getBoundKeyStrokes()
getBoundKeyStrokes
in interface javax.swing.text.Keymap
public javax.swing.Action[] getBoundActions()
getBoundActions
in interface javax.swing.text.Keymap
public javax.swing.KeyStroke[] getKeyStrokesForAction(javax.swing.Action a)
getKeyStrokesForAction
in interface javax.swing.text.Keymap
a
- the action we are interested inpublic boolean isLocallyDefined(javax.swing.KeyStroke key)
isLocallyDefined
in interface javax.swing.text.Keymap
key
- the key stroke we are interested inpublic void addActionForKeyStroke(javax.swing.KeyStroke key, javax.swing.Action a)
addActionForKeyStroke
in interface javax.swing.text.Keymap
key
- the key stroke that will have to trigger the actiona
- the action that should be triggered by the key stroke.public void removeKeyStrokeBinding(javax.swing.KeyStroke key)
removeKeyStrokeBinding
in interface javax.swing.text.Keymap
key
- the key stroke whose binding should be removed.public void removeBindings()
removeBindings
in interface javax.swing.text.Keymap
public java.util.Hashtable getBindings()
public void setBindings(java.util.Hashtable newBindings)
newBindings
- The table of new bindings for this keymap.public javax.swing.text.Keymap getResolveParent()
getResolveParent
in interface javax.swing.text.Keymap
public void setResolveParent(javax.swing.text.Keymap parent)
setResolveParent
in interface javax.swing.text.Keymap
parent
- the new parent keymappublic javax.swing.text.Keymap getMaster()
public void setMaster(javax.swing.text.Keymap master)
master
- The new master of this keymap.public java.lang.String toString()
toString
in class java.lang.Object
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |