|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.jdesktop.application.AbstractBean
org.jdesktop.application.ActionManager
public class ActionManager
The application's ActionManager provides read-only cached
access to ActionMaps that contain one entry for each method
marked with the @Action annotation in a class.
ApplicationContext.getActionMap(Object),
ApplicationActionMap,
ApplicationAction| Constructor Summary | |
|---|---|
protected |
ActionManager(ApplicationContext context)
|
| Method Summary | |
|---|---|
ApplicationActionMap |
getActionMap()
The ActionMap chain for the entire Application. |
ApplicationActionMap |
getActionMap(java.lang.Class actionsClass,
java.lang.Object actionsObject)
Returns the ApplicationActionMap chain for the specified
actions class and target object. |
protected ApplicationContext |
getContext()
|
| Methods inherited from class org.jdesktop.application.AbstractBean |
|---|
addPropertyChangeListener, addPropertyChangeListener, firePropertyChange, firePropertyChange, getPropertyChangeListeners, removePropertyChangeListener, removePropertyChangeListener |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
protected ActionManager(ApplicationContext context)
| Method Detail |
|---|
protected final ApplicationContext getContext()
public ApplicationActionMap getActionMap()
ActionMap chain for the entire Application.
Returns an ActionMap with the @Actions defined
in the application's Application subclass, i.e. the
the value of:
ApplicationContext.getInstance().getApplicationClass()The remainder of the chain contains one
ActionMap
for each superclass, up to Application.class. The
ActionMap.get() method searches the entire chain, so
logically, the ActionMap that this method returns contains
all of the application-global actions.
The value returned by this method is cached.
ActionMap chain for the entire Application.getActionMap(Class, Object),
ApplicationContext.getActionMap(),
ApplicationContext.getActionMap(Class, Object),
ApplicationContext.getActionMap(Object)
public ApplicationActionMap getActionMap(java.lang.Class actionsClass,
java.lang.Object actionsObject)
ApplicationActionMap 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 an ApplicationAction object
and all of them will be added to a single
ApplicationActionMap. All of the
ApplicationActions invoke their actionPerformed
method on the specified actionsObject.
The parent of the returned ActionMap is the global
ActionMap that contains the @Actions defined
in this application's Application 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 the ApplicationActionMap and ApplicationActions that refer to it. In other words, if you
drop all references to the actionsObject, including
its ApplicationActions and their ApplicationActionMaps, then the cached ActionMap entry
will be cleared.
ApplicationActionMap for actionsClass and actionsObjectgetActionMap(),
ApplicationContext.getActionMap(),
ApplicationContext.getActionMap(Class, Object),
ApplicationContext.getActionMap(Object)
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||