javax.swing.text
Class JTextComponent.KeymapWrapper

java.lang.Object
  extended byjavax.swing.InputMap
      extended byjavax.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.


Field Summary
(package private) static Object DefaultActionKey
           
private  Keymap keymap
           
 
Fields inherited from class javax.swing.InputMap
 
Constructor Summary
(package private) JTextComponent.KeymapWrapper(Keymap keymap)
           
 
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 KeyStrokes that are bound in this InputMap.
 int size()
          Returns the number of KeyStroke bindings.
 
Methods inherited from class javax.swing.InputMap
allKeys, clear, getParent, put, remove, setParent
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DefaultActionKey

static final Object DefaultActionKey

keymap

private Keymap keymap
Constructor Detail

JTextComponent.KeymapWrapper

JTextComponent.KeymapWrapper(Keymap keymap)
Method Detail

keys

public KeyStroke[] keys()
Description copied from class: InputMap
Returns the KeyStrokes 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