public abstract class AbstractActionManager extends java.lang.Object implements ActionManager
ACTION
Constructor and Description |
---|
AbstractActionManager(GriffonApplication application,
ActionFactory actionFactory,
ActionMetadataFactory actionMetadataFactory) |
Modifier and Type | Method and Description |
---|---|
Action |
actionFor(GriffonController controller,
java.lang.String actionName) |
java.util.Map<java.lang.String,Action> |
actionsFor(GriffonController controller) |
void |
addActionHandler(ActionHandler actionHandler)
Register an
ActionHandler with this instance. |
void |
addActionInterceptor(ActionInterceptor actionInterceptor)
Register an
ActionInterceptor with this instance. |
void |
createActions(GriffonController controller) |
protected Action |
createAndConfigureAction(GriffonController controller,
java.lang.String actionName,
java.lang.reflect.Method method) |
protected Action |
createControllerAction(GriffonController controller,
java.lang.String actionName,
java.lang.reflect.Method method) |
protected abstract void |
doConfigureAction(Action action,
GriffonController controller,
java.lang.String normalizeNamed,
java.lang.String keyPrefix) |
protected java.lang.Object |
doInvokeAction(GriffonController controller,
java.lang.String actionName,
java.lang.Object[] updatedArgs) |
protected Configuration |
getConfiguration() |
protected MessageSource |
getMessageSource() |
protected java.util.Map<java.lang.String,Threading.Policy> |
getThreadingPolicies() |
protected UIThreadManager |
getUiThreadManager() |
void |
invokeAction(Action action,
java.lang.Object... args)
Execute the action using registered
ActionHandler s. |
void |
invokeAction(GriffonController controller,
java.lang.String actionName,
java.lang.Object... args)
Execute the action using registered
ActionHandler s. |
protected boolean |
isThreadingDisabled(java.lang.String actionName) |
protected java.lang.String |
msg(java.lang.String key,
java.lang.String actionName,
java.lang.String subkey,
java.lang.String defaultValue) |
java.lang.String |
normalizeName(java.lang.String actionName) |
protected Threading.Policy |
resolveThreadingPolicy() |
protected Threading.Policy |
resolveThreadingPolicy(GriffonController controller) |
protected Threading.Policy |
resolveThreadingPolicy(GriffonController controller,
java.lang.String actionName) |
void |
updateAction(Action action)
Update the action's properties using registered
ActionHandler s. |
void |
updateAction(GriffonController controller,
java.lang.String actionName)
Update the action's properties using registered
ActionHandler s. |
void |
updateActions()
Updates all actions currently configured.
|
void |
updateActions(GriffonController controller)
Updates all actions belonging to the supplied controller.
|
@Inject public AbstractActionManager(@Nonnull GriffonApplication application, @Nonnull ActionFactory actionFactory, @Nonnull ActionMetadataFactory actionMetadataFactory)
@Nonnull protected Configuration getConfiguration()
@Nonnull protected MessageSource getMessageSource()
@Nonnull protected UIThreadManager getUiThreadManager()
@Nonnull protected java.util.Map<java.lang.String,Threading.Policy> getThreadingPolicies()
@Nonnull public java.util.Map<java.lang.String,Action> actionsFor(@Nonnull GriffonController controller)
actionsFor
in interface ActionManager
@Nullable public Action actionFor(@Nonnull GriffonController controller, @Nonnull java.lang.String actionName)
actionFor
in interface ActionManager
public void createActions(@Nonnull GriffonController controller)
createActions
in interface ActionManager
public void updateActions()
ActionManager
updateActions
in interface ActionManager
public void updateActions(@Nonnull GriffonController controller)
ActionManager
updateActions
in interface ActionManager
controller
- the controller that owns the actions to be updated.public void updateAction(@Nonnull Action action)
ActionManager
ActionHandler
s.updateAction
in interface ActionManager
action
- the action to be updatedpublic void updateAction(@Nonnull GriffonController controller, @Nonnull java.lang.String actionName)
ActionManager
ActionHandler
s.updateAction
in interface ActionManager
controller
- the controller that owns the actionactionName
- the action's namepublic void invokeAction(@Nonnull Action action, @Nonnull java.lang.Object... args)
ActionManager
ActionHandler
s.invokeAction
in interface ActionManager
action
- the action to be invokedargs
- additional arguments to be sent to the actionpublic void invokeAction(@Nonnull GriffonController controller, @Nonnull java.lang.String actionName, @Nonnull java.lang.Object... args)
ActionManager
ActionHandler
s.invokeAction
in interface ActionManager
controller
- the controller that owns the actionactionName
- the action's nameargs
- additional arguments to be sent to the action@Nullable protected java.lang.Object doInvokeAction(@Nonnull GriffonController controller, @Nonnull java.lang.String actionName, @Nonnull java.lang.Object[] updatedArgs)
@Nonnull protected Threading.Policy resolveThreadingPolicy(@Nonnull GriffonController controller, @Nonnull java.lang.String actionName)
@Nonnull protected Threading.Policy resolveThreadingPolicy(@Nonnull GriffonController controller)
@Nonnull protected Threading.Policy resolveThreadingPolicy()
protected boolean isThreadingDisabled(@Nonnull java.lang.String actionName)
public void addActionHandler(@Nonnull ActionHandler actionHandler)
ActionManager
ActionHandler
with this instance.addActionHandler
in interface ActionManager
actionHandler
- the handler to be added to this ActionManagerpublic void addActionInterceptor(@Nonnull ActionInterceptor actionInterceptor)
ActionManager
ActionInterceptor
with this instance.addActionInterceptor
in interface ActionManager
actionInterceptor
- the interceptor to be added to this ActionManager@Nonnull protected Action createAndConfigureAction(@Nonnull GriffonController controller, @Nonnull java.lang.String actionName, @Nonnull java.lang.reflect.Method method)
protected abstract void doConfigureAction(@Nonnull Action action, @Nonnull GriffonController controller, @Nonnull java.lang.String normalizeNamed, @Nonnull java.lang.String keyPrefix)
@Nonnull protected Action createControllerAction(@Nonnull GriffonController controller, @Nonnull java.lang.String actionName, @Nonnull java.lang.reflect.Method method)
@Nonnull public java.lang.String normalizeName(@Nonnull java.lang.String actionName)
normalizeName
in interface ActionManager
@Nullable protected java.lang.String msg(@Nonnull java.lang.String key, @Nonnull java.lang.String actionName, @Nonnull java.lang.String subkey, @Nullable java.lang.String defaultValue)