All Packages  Class Hierarchy  This Package  Previous  Next  Index

Interface com.sun.java.swing.text.Keymap

public interface Keymap
A collection of bindings of KeyStrokes to actions. The bindings are basically name-value pairs that potentially resolve in a hierarchy.


Method Index

 o addActionForKeyStroke(KeyStroke, Action)
Adds a binding to the keymap.
 o getAction(KeyStroke)
Fetches the action appropriate for the given symbolic event sequence.
 o getBoundActions()
Fetches all of the actions defined in this keymap.
 o getBoundKeyStrokes()
Fetches all of the keystrokes in this map that are bound to some action.
 o getKeyStrokesForAction(Action)
Fetches the keystrokes that will result in the given action.
 o getName()
Fetches the name of the set of key-bindings.
 o getResolveParent()
Fetches the parent keymap used to resolve key-bindings.
 o isLocallyDefined(KeyStroke)
Determines if the given key sequence is locally defined.
 o removeBindings()
Removes all bindings from the keymap.
 o removeKeyStrokeBinding(KeyStroke)
Removes a binding from the keymap.
 o setResolveParent(Keymap)
Sets the parent keymap, which will be used to resolve key-bindings.

Methods

 o getName
 public abstract String getName()
Fetches the name of the set of key-bindings.

Returns:
the name
 o getAction
 public abstract Action getAction(KeyStroke key)
Fetches the action appropriate for the given symbolic event sequence. This is used by JTextController to determine how to interpret key sequences. If the binding is not resolved locally, an attempt is made to resolve through the parent keymap, if one is set.

Parameters:
key - the key sequence
Returns:
s the action associated with the key sequence if one is defined, otherwise null
 o getBoundKeyStrokes
 public abstract KeyStroke[] getBoundKeyStrokes()
Fetches all of the keystrokes in this map that are bound to some action.

Returns:
the list of keystrokes
 o getBoundActions
 public abstract Action[] getBoundActions()
Fetches all of the actions defined in this keymap.

Returns:
the list of actions
 o getKeyStrokesForAction
 public abstract KeyStroke[] getKeyStrokesForAction(Action a)
Fetches the keystrokes that will result in the given action.

Parameters:
a - the action
Returns:
the list of keystrokes
 o isLocallyDefined
 public abstract boolean isLocallyDefined(KeyStroke key)
Determines if the given key sequence is locally defined.

Parameters:
key - the key sequence
Returns:
true if the key sequence is locally defined else false
 o addActionForKeyStroke
 public abstract void addActionForKeyStroke(KeyStroke key,
                                            Action a)
Adds a binding to the keymap.

Parameters:
key - the key sequence
a - the action
 o removeKeyStrokeBinding
 public abstract void removeKeyStrokeBinding(KeyStroke keys)
Removes a binding from the keymap.

Parameters:
keys - the key sequence
 o removeBindings
 public abstract void removeBindings()
Removes all bindings from the keymap.

 o getResolveParent
 public abstract Keymap getResolveParent()
Fetches the parent keymap used to resolve key-bindings.

Returns:
the keymap
 o setResolveParent
 public abstract void setResolveParent(Keymap parent)
Sets the parent keymap, which will be used to resolve key-bindings.

Parameters:
parent - the parent keymap

All Packages  Class Hierarchy  This Package  Previous  Next  Index