org.jhotdraw.gui.plaf.palette
Class PaletteLazyActionMap

java.lang.Object
  extended by javax.swing.ActionMap
      extended by javax.swing.plaf.ActionMapUIResource
          extended by org.jhotdraw.gui.plaf.palette.PaletteLazyActionMap
All Implemented Interfaces:
java.io.Serializable, javax.swing.plaf.UIResource

public class PaletteLazyActionMap
extends javax.swing.plaf.ActionMapUIResource

QuaquaLazyActionMap.

Author:
Werner Randelshofer  @version $Id: PaletteLazyActionMap.java 573 2009-10-13 05:59:20Z rawcoder $
See Also:
Serialized Form

Field Summary
private  java.lang.Object _loader
          Object to invoke loadActionMap on.
 
Constructor Summary
private PaletteLazyActionMap(java.lang.Class loader)
           
 
Method Summary
 java.lang.Object[] allKeys()
           
 void clear()
           
 javax.swing.Action get(java.lang.Object key)
           
(package private) static javax.swing.ActionMap getActionMap(java.lang.Class loaderClass, java.lang.String defaultsKey)
          Returns an ActionMap that will be populated by invoking the loadActionMap method on the specified Class when necessary.
(package private) static void installLazyActionMap(javax.swing.JComponent c, java.lang.Class loaderClass, java.lang.String defaultsKey)
          Installs an ActionMap that will be populated by invoking the loadActionMap method on the specified Class when necessary.
 java.lang.Object[] keys()
           
private  void loadIfNecessary()
           
 void put(javax.swing.Action action)
           
 void put(java.lang.Object key, javax.swing.Action action)
           
 void remove(java.lang.Object key)
           
 void setParent(javax.swing.ActionMap map)
           
 int size()
           
 
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
 

Field Detail

_loader

private transient java.lang.Object _loader
Object to invoke loadActionMap on. This may be a Class object.

Constructor Detail

PaletteLazyActionMap

private PaletteLazyActionMap(java.lang.Class loader)
Method Detail

installLazyActionMap

static void installLazyActionMap(javax.swing.JComponent c,
                                 java.lang.Class loaderClass,
                                 java.lang.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.

getActionMap

static javax.swing.ActionMap getActionMap(java.lang.Class loaderClass,
                                          java.lang.String defaultsKey)
Returns 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:
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(javax.swing.Action action)

put

public void put(java.lang.Object key,
                javax.swing.Action action)
Overrides:
put in class javax.swing.ActionMap

get

public javax.swing.Action get(java.lang.Object key)
Overrides:
get in class javax.swing.ActionMap

remove

public void remove(java.lang.Object key)
Overrides:
remove in class javax.swing.ActionMap

clear

public void clear()
Overrides:
clear in class javax.swing.ActionMap

keys

public java.lang.Object[] keys()
Overrides:
keys in class javax.swing.ActionMap

size

public int size()
Overrides:
size in class javax.swing.ActionMap

allKeys

public java.lang.Object[] allKeys()
Overrides:
allKeys in class javax.swing.ActionMap

setParent

public void setParent(javax.swing.ActionMap map)
Overrides:
setParent in class javax.swing.ActionMap

loadIfNecessary

private void loadIfNecessary()