Class ActionManager
ActionManager
provides read-only cached
access to ActionMaps
that contain one entry for each method
marked with the @Action
annotation in a class.- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionTheActionMap
chain for the entireApplication
.getActionMap
(Class actionsClass, Object actionsObject) Returns theApplicationActionMap
chain for the specified actions class and target object.protected final ApplicationContext
Methods inherited from class org.jdesktop.application.AbstractBean
addPropertyChangeListener, addPropertyChangeListener, firePropertyChange, firePropertyChange, getPropertyChangeListeners, removePropertyChangeListener, removePropertyChangeListener
-
Constructor Details
-
ActionManager
-
-
Method Details
-
getContext
-
getActionMap
TheActionMap
chain for the entireApplication
.Returns an
ActionMap
with the@Actions
defined in the application'sApplication
subclass, i.e. the the value of:ApplicationContext.getInstance().getApplicationClass()
The remainder of the chain contains oneActionMap
for each superclass, up toApplication.class
. TheActionMap.get()
method searches the entire chain, so logically, theActionMap
that this method returns contains all of the application-global actions.The value returned by this method is cached.
- Returns:
- the
ActionMap
chain for the entireApplication
. - See Also:
-
getActionMap
Returns theApplicationActionMap
chain for the specified actions class and target object.The specified class can contain methods marked with the
@Action
annotation. Each one will be turned into anApplicationAction
object and all of them will be added to a singleApplicationActionMap
. All of theApplicationActions
invoke theiractionPerformed
method on the specifiedactionsObject
. The parent of the returnedActionMap
is the globalActionMap
that contains the@Actions
defined in this application'sApplication
subclass.To bind an
@Action
to a Swing component, one specifies the@Action's
name in an expression like this:ApplicationContext ctx = Application.getInstance(MyApplication.class).getContext(); MyActions myActions = new MyActions(); myComponent.setAction(ac.getActionMap(myActions).get("myAction"));
The value returned by this method is cached. The lifetime of the cached entry will be the same as the lifetime of the
actionsObject
and theApplicationActionMap
andApplicationActions
that refer to it. In other words, if you drop all references to theactionsObject
, including itsApplicationActions
and theirApplicationActionMaps
, then the cachedActionMap
entry will be cleared.- Returns:
- the
ApplicationActionMap
foractionsClass
andactionsObject
- See Also:
-