public class ActionMap extends Object
ActionProxy to Action.
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");
}
}
ActionProxy,
Action| Modifier and Type | Method and Description |
|---|---|
static Action |
action(String id)
Returns action by it's id
|
static Collection<Action> |
actions(String... ids)
Returns collection of actions by ids.
|
static void |
register(Object target)
Attempts to convert target's methods annotated with
ActionProxy to Actions. |
void |
unregister(Object target)
Removes all the actions associated with target object from the action amp
|
public static void register(Object target)
ActionProxy to Actions.
Only two types of methods are currently converted: parameter-less methods and
methods with one parameter of type ActionEvent.
Actions are registered with their id or method name if id is not defined.target - object to work onIllegalArgumentException - on duplicate action idpublic void unregister(Object target)
target - object to work onpublic static Action action(String id)
id - action idpublic static Collection<Action> actions(String... ids)
ActionGroups.
Ids starting with "---" are converted to ActionUtils.ACTION_SEPARATOR
Incorrect ids are ignored.ids - action ids