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 TypeMethodDescriptionTheActionMapchain for the entireApplication.getActionMap(Class actionsClass, Object actionsObject) Returns theApplicationActionMapchain for the specified actions class and target object.protected final ApplicationContextMethods inherited from class org.jdesktop.application.AbstractBean
addPropertyChangeListener, addPropertyChangeListener, firePropertyChange, firePropertyChange, getPropertyChangeListeners, removePropertyChangeListener, removePropertyChangeListener
-
Constructor Details
-
ActionManager
-
-
Method Details
-
getContext
-
getActionMap
TheActionMapchain for the entireApplication.Returns an
ActionMapwith the@Actionsdefined in the application'sApplicationsubclass, i.e. the the value of:ApplicationContext.getInstance().getApplicationClass()
The remainder of the chain contains oneActionMapfor each superclass, up toApplication.class. TheActionMap.get()method searches the entire chain, so logically, theActionMapthat this method returns contains all of the application-global actions.The value returned by this method is cached.
- Returns:
- the
ActionMapchain for the entireApplication. - See Also:
-
getActionMap
Returns theApplicationActionMapchain for the specified actions class and target object.The specified class can contain methods marked with the
@Actionannotation. Each one will be turned into anApplicationActionobject and all of them will be added to a singleApplicationActionMap. All of theApplicationActionsinvoke theiractionPerformedmethod on the specifiedactionsObject. The parent of the returnedActionMapis the globalActionMapthat contains the@Actionsdefined in this application'sApplicationsubclass.To bind an
@Actionto a Swing component, one specifies the@Action'sname 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
actionsObjectand theApplicationActionMapandApplicationActionsthat refer to it. In other words, if you drop all references to theactionsObject, including itsApplicationActionsand theirApplicationActionMaps, then the cachedActionMapentry will be cleared.- Returns:
- the
ApplicationActionMapforactionsClassandactionsObject - See Also:
-