Methods Summary |
---|
public java.lang.Object[] | allKeys()
loadIfNecessary();
return super.allKeys();
|
public void | clear()
loadIfNecessary();
super.clear();
|
public javax.swing.Action | get(java.lang.Object key)
loadIfNecessary();
return super.get(key);
|
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.
ActionMap map = (ActionMap)UIManager.get(defaultsKey);
if (map == null) {
map = new LazyActionMap(loaderClass);
UIManager.getLookAndFeelDefaults().put(defaultsKey, map);
}
return map;
|
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.
ActionMap map = (ActionMap)UIManager.get(defaultsKey);
if (map == null) {
map = new LazyActionMap(loaderClass);
UIManager.getLookAndFeelDefaults().put(defaultsKey, map);
}
SwingUtilities.replaceUIActionMap(c, map);
|
public java.lang.Object[] | keys()
loadIfNecessary();
return super.keys();
|
private void | loadIfNecessary()
if (_loader != null) {
Object loader = _loader;
_loader = null;
Class klass = (Class)loader;
try {
Method method = klass.getDeclaredMethod("loadActionMap",
new Class[] { LazyActionMap.class });
method.invoke(klass, new Object[] { this });
} catch (NoSuchMethodException nsme) {
assert false : "LazyActionMap unable to load actions " +
klass;
} catch (IllegalAccessException iae) {
assert false : "LazyActionMap unable to load actions " +
iae;
} catch (InvocationTargetException ite) {
assert false : "LazyActionMap unable to load actions " +
ite;
} catch (IllegalArgumentException iae) {
assert false : "LazyActionMap unable to load actions " +
iae;
}
}
|
public void | put(javax.swing.Action action)
put(action.getValue(Action.NAME), action);
|
public void | put(java.lang.Object key, javax.swing.Action action)
loadIfNecessary();
super.put(key, action);
|
public void | remove(java.lang.Object key)
loadIfNecessary();
super.remove(key);
|
public void | setParent(javax.swing.ActionMap map)
loadIfNecessary();
super.setParent(map);
|
public int | size()
loadIfNecessary();
return super.size();
|