javax.swing.text
Class JTextComponent.KeymapWrapper
java.lang.Object
javax.swing.InputMap
javax.swing.text.JTextComponent.KeymapWrapper
- All Implemented Interfaces:
- Serializable
- Enclosing class:
- JTextComponent
- static class JTextComponent.KeymapWrapper
- extends InputMap
KeymapWrapper wraps a Keymap inside an InputMap. For KeymapWrapper
to be useful it must be used with a KeymapActionMap.
KeymapWrapper for the most part, is an InputMap with two parents.
The first parent visited is ALWAYS the Keymap, with the second
parent being the parent inherited from InputMap. If
keymap.getAction
returns null, implying the Keymap
does not have a binding for the KeyStroke,
the parent is then visited. If the Keymap has a binding, the
Action is returned, if not and the KeyStroke represents a
KeyTyped event and the Keymap has a defaultAction,
DefaultActionKey
is returned.
KeymapActionMap is then able to transate the object passed in
to either message the Keymap, or message its default implementation.
Fields inherited from class javax.swing.InputMap |
|
Method Summary |
Object |
get(KeyStroke keyStroke)
Returns the binding for keyStroke , messaging the
parent InputMap if the binding is not locally defined. |
KeyStroke[] |
keys()
Returns the KeyStroke s that are bound in this InputMap . |
int |
size()
Returns the number of KeyStroke bindings. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
DefaultActionKey
static final Object DefaultActionKey
keymap
private Keymap keymap
JTextComponent.KeymapWrapper
JTextComponent.KeymapWrapper(Keymap keymap)
keys
public KeyStroke[] keys()
- Description copied from class:
InputMap
- Returns the
KeyStroke
s that are bound in this InputMap
.
- Overrides:
keys
in class InputMap
size
public int size()
- Description copied from class:
InputMap
- Returns the number of
KeyStroke
bindings.
- Overrides:
size
in class InputMap
get
public Object get(KeyStroke keyStroke)
- Description copied from class:
InputMap
- Returns the binding for
keyStroke
, messaging the
parent InputMap
if the binding is not locally defined.
- Overrides:
get
in class InputMap