|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjavax.swing.ActionMap
org.jdesktop.application.ApplicationActionMap
public class ApplicationActionMap
An ActionMap
class where each entry
corresponds to an @Action method from a single
actionsClass (i.e. a class that contains one or more
@Actions). Each entry's key is the @Action's
name (the method name by default), and the value is an
ApplicationAction
that calls the @Actions method.
For example, the code below prints "Hello World":
public class HelloWorldActions { public @Action void Hello() { System.out.print("Hello "); } public @Action void World() { System.out.println("World"); } } // ... ApplicationActionMap appAM = new ApplicationActionMap(SimpleActions.class); ActionEvent e = new ActionEvent("no src", ActionEvent.ACTION_PERFORMED, "no cmd"); appAM.get("Hello").actionPerformed(e); appAM.get("World").actionPerformed(e);
If a ResourceMap is provided then each
ApplicationAction's (putValue
, getValue
) properties
are initialized from the ResourceMap.
ApplicationAction
,
ResourceMap
,
Serialized FormConstructor Summary | |
---|---|
ApplicationActionMap(ApplicationContext context,
java.lang.Class actionsClass,
java.lang.Object actionsObject,
ResourceMap resourceMap)
Creates ApplicationActionMap object. |
Method Summary | |
---|---|
java.lang.Class |
getActionsClass()
Returns the base class for actions retrieval |
java.lang.Object |
getActionsObject()
Returns the object with actions |
ApplicationContext |
getContext()
Returns the ApplicationContext |
java.util.List<ApplicationAction> |
getProxyActions()
All of the @ProxyActions recursively defined by this
ApplicationActionMap and its parent ancestors. |
Methods inherited from class javax.swing.ActionMap |
---|
allKeys, clear, get, getParent, keys, put, remove, setParent, size |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public ApplicationActionMap(ApplicationContext context, java.lang.Class actionsClass, java.lang.Object actionsObject, ResourceMap resourceMap)
ApplicationActionMap
object.
The created action map will contain actions which are defined in the actionsObject
and all
its ancestors up to the actionsClass
. If actionsClass
is a type of the actionsObject
then
actions only from this class will be added to the map.
context
- the Application contextactionsClass
- a super class for the actionsObject
. Actions will be retrieved starting from this class.actionsObject
- the object to be scanned for the actions.resourceMap
- the ResourceMap
to be used for those actionsMethod Detail |
---|
public final ApplicationContext getContext()
ApplicationContext
ApplicationContext
public final java.lang.Class getActionsClass()
public final java.lang.Object getActionsObject()
public java.util.List<ApplicationAction> getProxyActions()
@ProxyActions
recursively defined by this
ApplicationActionMap
and its parent ancestors.
Returns a read-only list of the @ProxyActions
defined
by this ApplicationActionMap's
actionClass
and, recursively, by this ApplicationActionMap's
parent.
If there are no proxyActions, an empty list is returned.
ApplicationActionMap
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |