org.jdesktop.swingx.plaf.basic.core
Class LazyActionMap

java.lang.Object
  extended by javax.swing.ActionMap
      extended by javax.swing.plaf.ActionMapUIResource
          extended by org.jdesktop.swingx.plaf.basic.core.LazyActionMap
All Implemented Interfaces:
Serializable, UIResource

public class LazyActionMap
extends ActionMapUIResource

An ActionMap that populates its contents as necessary. The contents are populated by invoking the loadActionMap method on the passed in Object.

See Also:
Serialized Form

Method Summary
 Object[] allKeys()
          Returns an array of the keys defined in this ActionMap and its parent.
 void clear()
          Removes all the mappings from this ActionMap.
 Action get(Object key)
          Returns the binding for key, messaging the parent ActionMap if the binding is not locally defined.
static void installLazyActionMap(JComponent c, Class loaderClass, String defaultsKey)
          Installs an ActionMap that will be populated by invoking the loadActionMap method on the specified Class when necessary.
 Object[] keys()
          Returns the Action names that are bound in this ActionMap.
 void put(Action action)
           
 void put(Object key, Action action)
          Adds a binding for key to action.
 void remove(Object key)
          Removes the binding for key from this ActionMap.
 void setParent(ActionMap map)
          Sets this ActionMap's parent.
 int size()
          Returns the number of KeyStroke bindings.
 
Methods inherited from class javax.swing.ActionMap
getParent
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

installLazyActionMap

public static void installLazyActionMap(JComponent c,
                                        Class loaderClass,
                                        String defaultsKey)
Installs an ActionMap that will be populated by invoking the loadActionMap method on the specified Class when necessary.

This should be used if the ActionMap can be shared.

Parameters:
c - JComponent to install the ActionMap on.
loaderClass - Class object that gets loadActionMap invoked on.
defaultsKey - Key to use to defaults table to check for existing map and what resulting Map will be registered on.

put

public void put(Action action)

put

public void put(Object key,
                Action action)
Description copied from class: javax.swing.ActionMap
Adds a binding for key to action. If action is null, this removes the current binding for key.

In most instances, key will be action.getValue(NAME).

Overrides:
put in class ActionMap

get

public Action get(Object key)
Description copied from class: javax.swing.ActionMap
Returns the binding for key, messaging the parent ActionMap if the binding is not locally defined.

Overrides:
get in class ActionMap

remove

public void remove(Object key)
Description copied from class: javax.swing.ActionMap
Removes the binding for key from this ActionMap.

Overrides:
remove in class ActionMap

clear

public void clear()
Description copied from class: javax.swing.ActionMap
Removes all the mappings from this ActionMap.

Overrides:
clear in class ActionMap

keys

public Object[] keys()
Description copied from class: javax.swing.ActionMap
Returns the Action names that are bound in this ActionMap.

Overrides:
keys in class ActionMap

size

public int size()
Description copied from class: javax.swing.ActionMap
Returns the number of KeyStroke bindings.

Overrides:
size in class ActionMap

allKeys

public Object[] allKeys()
Description copied from class: javax.swing.ActionMap
Returns an array of the keys defined in this ActionMap and its parent. This method differs from keys() in that this method includes the keys defined in the parent.

Overrides:
allKeys in class ActionMap

setParent

public void setParent(ActionMap map)
Description copied from class: javax.swing.ActionMap
Sets this ActionMap's parent.

Overrides:
setParent in class ActionMap
Parameters:
map - the ActionMap that is the parent of this one