APIdia Launch Partner
Top Description Fields Constructors Methods
javax.swing.plaf.basic

pack-priv Class LazyActionMap

extends ActionMapUIResource
Class Inheritance
Annotations
@SuppressWarnings:serial
Imports
java.lang.reflect.*, javax.swing.*, javax.swing.plaf.*

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

Field Summary

Modifier and TypeField and Description
private transient Object
_loader

Object to invoke loadActionMap on.

Constructor Summary

AccessConstructor and Description
private
LazyActionMap(Class<?> loader)

Method Summary

Modifier and TypeMethod and Description
public Object[]
allKeys()

Overrides javax.swing.ActionMap.allKeys.

Returns an array of the keys defined in this ActionMap and its parent.

public void
clear()

Overrides javax.swing.ActionMap.clear.

Removes all the mappings from this ActionMap.

public Action
get(Object key)

Overrides javax.swing.ActionMap.get.

Returns the binding for key, messaging the parent ActionMap if the binding is not locally defined.

pack-priv static ActionMap
getActionMap(Class<?>
Class object that gets loadActionMap invoked on.
loaderClass
,
String
Key to use to defaults table to check for existing map and what resulting Map will be registered on.
defaultsKey
)

Returns an ActionMap that will be populated by invoking the loadActionMap method on the specified Class when necessary.

pack-priv static void
installLazyActionMap(JComponent
JComponent to install the ActionMap on.
c
,
Class<?>
Class object that gets loadActionMap invoked on.
loaderClass
,
String
Key to use to defaults table to check for existing map and what resulting Map will be registered on.
defaultsKey
)

Installs an ActionMap that will be populated by invoking the loadActionMap method on the specified Class when necessary.

public Object[]
keys()

Overrides javax.swing.ActionMap.keys.

Returns the Action names that are bound in this ActionMap.

private void
public void
put(Action action)

public void
put(Object key, Action action)

Overrides javax.swing.ActionMap.put.

Adds a binding for key to action.

public void
remove(Object key)

Overrides javax.swing.ActionMap.remove.

Removes the binding for key from this ActionMap.

public void
setParent(ActionMap map)

Overrides javax.swing.ActionMap.setParent.

Sets this ActionMap's parent.

public int
size()

Overrides javax.swing.ActionMap.size.

Returns the number of bindings in this ActionMap.

Field Detail

_loaderback to summary
private transient Object _loader

Object to invoke loadActionMap on. This may be a Class object.

Constructor Detail

LazyActionMapback to summary
private LazyActionMap(Class<?> loader)

Method Detail

allKeysback to summary
public Object[] allKeys()

Overrides javax.swing.ActionMap.allKeys.

Doc from javax.swing.ActionMap.allKeys.

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.

clearback to summary
public void clear()

Overrides javax.swing.ActionMap.clear.

Doc from javax.swing.ActionMap.clear.

Removes all the mappings from this ActionMap.

getback to summary
public Action get(Object key)

Overrides javax.swing.ActionMap.get.

Doc from javax.swing.ActionMap.get.

Returns the binding for key, messaging the parent ActionMap if the binding is not locally defined.

getActionMapback to summary
pack-priv static ActionMap getActionMap(Class<?> loaderClass, 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<?>

Class object that gets loadActionMap invoked on.

defaultsKey:String

Key to use to defaults table to check for existing map and what resulting Map will be registered on.

installLazyActionMapback to summary
pack-priv 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

JComponent to install the ActionMap on.

loaderClass:Class<?>

Class object that gets loadActionMap invoked on.

defaultsKey:String

Key to use to defaults table to check for existing map and what resulting Map will be registered on.

keysback to summary
public Object[] keys()

Overrides javax.swing.ActionMap.keys.

Doc from javax.swing.ActionMap.keys.

Returns the Action names that are bound in this ActionMap.

loadIfNecessaryback to summary
private void loadIfNecessary()
putback to summary
public void put(Action action)
putback to summary
public void put(Object key, Action action)

Overrides javax.swing.ActionMap.put.

Doc from javax.swing.ActionMap.put.

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).

removeback to summary
public void remove(Object key)

Overrides javax.swing.ActionMap.remove.

Doc from javax.swing.ActionMap.remove.

Removes the binding for key from this ActionMap.

setParentback to summary
public void setParent(ActionMap map)

Overrides javax.swing.ActionMap.setParent.

Doc from javax.swing.ActionMap.setParent.

Sets this ActionMap's parent.

sizeback to summary
public int size()

Overrides javax.swing.ActionMap.size.

Doc from javax.swing.ActionMap.size.

Returns the number of bindings in this ActionMap.