ActionProxy to Action.
ActionMap#action(String) method:
public class ActionMapDemo extends Application {
public ActionMapDemo() {
ActionMap.register(this);
Action action11 = ActionMap.action("action11");
Button actionButton = ActionUtils.createButton(action11);
}
@ActionProxy(text="Action 1.1", graphic="start.png", accelerator="ctrl+shift+T")
private void action11() {
System.out.println( "Action 1.1 is executed");
}
}
If you require more control over the creation of the Action objects, you can either set the
global ActionFactory by calling ActionMap.setActionFactory() and/or you can use the factory
property on individual @ActionProxy declarations to set the factory on a case-by-case basis.
ActionProxy, Action
| Modifier and Type | Field and Description |
|---|---|
| private static AnnotatedActionFactory | |
| private static final Map |
| Access | Constructor and Description |
|---|---|
| private |
| Modifier and Type | Method and Description |
|---|---|
| public static Action | |
| public static Collection | |
| private static AnnotatedActionFactory | |
| public static AnnotatedActionFactory | getActionFactory()
Returns the action factory used by ActionMap to construct AnnotatedAction instances. |
| public static void | register(Object
object to work on target)Attempts to convert target's methods annotated with |
| public static void | setActionFactory(AnnotatedActionFactory factory)
Sets the action factory used by ActionMap to construct AnnotatedAction instances. |
| public static void | unregister(Object
object to work on target)Removes all the actions associated with target object from the action map. |
| actionFactory | back to summary |
|---|---|
| private static AnnotatedActionFactory actionFactory | |
| actions | back to summary |
|---|---|
| private static final Map<String, AnnotatedAction> actions | |
| ActionMap | back to summary |
|---|---|
| private ActionMap() | |
| action | back to summary |
|---|---|
| public static Action action(String id) Returns action by its id. | |
| actions | back to summary |
|---|---|
| public static Collection Returns collection of actions by ids. Useful to create
| |
| determineActionFactory | back to summary |
|---|---|
| private static AnnotatedActionFactory determineActionFactory(ActionProxy annotation) | |
| getActionFactory | back to summary |
|---|---|
| public static AnnotatedActionFactory getActionFactory() Returns the action factory used by ActionMap to construct AnnotatedAction instances. By default, this
is an instance of | |
| register | back to summary |
|---|---|
| public static void register(Object target) Attempts to convert target's methods annotated with
| |
| setActionFactory | back to summary |
|---|---|
| public static void setActionFactory(AnnotatedActionFactory factory) Sets the action factory used by ActionMap to construct AnnotatedAction instances. This factory can be overridden on
a case-by-case basis by specifying a factory class in | |
| unregister | back to summary |
|---|---|
| public static void unregister(Object target) Removes all the actions associated with target object from the action map.
| |