Package org.jdesktop.application
Class ApplicationActionMap
- java.lang.Object
-
- javax.swing.ActionMap
-
- org.jdesktop.application.ApplicationActionMap
-
- All Implemented Interfaces:
java.io.Serializable
public class ApplicationActionMap extends javax.swing.ActionMap
AnActionMap
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 anApplicationAction
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.TBD: explain use of resourcemap including action types, actionsObject, actionsClass, ProxyActions,
- See Also:
ApplicationAction
,ResourceMap
, Serialized Form
-
-
Constructor Summary
Constructors Constructor Description ApplicationActionMap(ApplicationContext context, java.lang.Class actionsClass, java.lang.Object actionsObject, ResourceMap resourceMap)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.Class
getActionsClass()
java.lang.Object
getActionsObject()
ApplicationContext
getContext()
java.util.List<ApplicationAction>
getProxyActions()
All of the@ProxyActions
recursively defined by thisApplicationActionMap
and its parent ancestors.
-
-
-
Constructor Detail
-
ApplicationActionMap
public ApplicationActionMap(ApplicationContext context, java.lang.Class actionsClass, java.lang.Object actionsObject, ResourceMap resourceMap)
-
-
Method Detail
-
getContext
public final ApplicationContext getContext()
-
getActionsClass
public final java.lang.Class getActionsClass()
-
getActionsObject
public final java.lang.Object getActionsObject()
-
getProxyActions
public java.util.List<ApplicationAction> getProxyActions()
All of the@ProxyActions
recursively defined by thisApplicationActionMap
and its parent ancestors.Returns a read-only list of the
@ProxyActions
defined by thisApplicationActionMap's
actionClass
and, recursively, by thisApplicationActionMap's
parent. If there are no proxyActions, an empty list is returned.- Returns:
- a list of all the proxyActions for this
ApplicationActionMap
-
-