public class ActionUtils extends Object
Action API. Primarily this class
is used to conveniently create UI controls from a given Action (this is
necessary for now as there is no built-in support for Action in JavaFX
UI controls at present).
Some of the methods in this class take a Collection of
actions. In these cases, it is likely they are designed to
work with action groups. For examples on how to work with
these methods, refer to the ActionGroup class documentation.
Action,
ActionGroup| Modifier and Type | Class and Description |
|---|---|
static class |
ActionUtils.ActionTextBehavior
Action text behavior.
|
| Modifier and Type | Field and Description |
|---|---|
static Action |
ACTION_SEPARATOR
Action representation of the generic separator.
|
| Modifier and Type | Method and Description |
|---|---|
static Button |
createButton(Action action)
|
static Button |
createButton(Action action,
ActionUtils.ActionTextBehavior textBehavior)
|
static ButtonBar |
createButtonBar(Collection<? extends Action> actions)
Takes the provided
Collection of Action (or subclasses,
such as ActionGroup) instances and returns a ButtonBar
populated with appropriate nodes bound to the provided
actions. |
static CheckBox |
createCheckBox(Action action)
|
static CheckMenuItem |
createCheckMenuItem(Action action)
Takes the provided
Action and returns a CheckMenuItem instance
with all relevant properties bound to the properties of the Action. |
static ContextMenu |
createContextMenu(Collection<? extends Action> actions)
Takes the provided
Collection of Action (or subclasses,
such as ActionGroup) instances and returns a ContextMenu
populated with appropriate nodes bound to the provided
actions. |
static Hyperlink |
createHyperlink(Action action)
|
static Menu |
createMenu(Action action)
|
static MenuBar |
createMenuBar(Collection<? extends Action> actions)
Takes the provided
Collection of Action (or subclasses,
such as ActionGroup) instances and returns a MenuBar
populated with appropriate nodes bound to the provided
actions. |
static MenuButton |
createMenuButton(Action action)
Takes the provided
Action and returns a MenuButton instance
with all relevant properties bound to the properties of the Action. |
static MenuButton |
createMenuButton(Action action,
ActionUtils.ActionTextBehavior textBehavior)
Takes the provided
Action and returns a MenuButton instance
with all relevant properties bound to the properties of the Action. |
static MenuItem |
createMenuItem(Action action)
|
static RadioButton |
createRadioButton(Action action)
Takes the provided
Action and returns a RadioButton instance
with all relevant properties bound to the properties of the Action. |
static RadioMenuItem |
createRadioMenuItem(Action action)
Takes the provided
Action and returns a RadioMenuItem instance
with all relevant properties bound to the properties of the Action. |
static SegmentedButton |
createSegmentedButton(Action... actions)
Takes the provided varargs array of
Action and returns a SegmentedButton instance
with all relevant properties bound to the properties of the actions. |
static SegmentedButton |
createSegmentedButton(ActionUtils.ActionTextBehavior textBehavior,
Action... actions)
Takes the provided varargs array of
Action and returns a SegmentedButton instance
with all relevant properties bound to the properties of the actions. |
static SegmentedButton |
createSegmentedButton(ActionUtils.ActionTextBehavior textBehavior,
Collection<? extends Action> actions)
Takes the provided
Collection of Action and returns a SegmentedButton instance
with all relevant properties bound to the properties of the actions. |
static SegmentedButton |
createSegmentedButton(Collection<? extends Action> actions)
Takes the provided
Collection of Action and returns a SegmentedButton instance
with all relevant properties bound to the properties of the actions. |
static ToggleButton |
createToggleButton(Action action)
Takes the provided
Action and returns a ToggleButton instance
with all relevant properties bound to the properties of the Action. |
static ToggleButton |
createToggleButton(Action action,
ActionUtils.ActionTextBehavior textBehavior)
Takes the provided
Action and returns a ToggleButton instance
with all relevant properties bound to the properties of the Action. |
static ToolBar |
createToolBar(Collection<? extends Action> actions,
ActionUtils.ActionTextBehavior textBehavior)
Takes the provided
Collection of Action (or subclasses,
such as ActionGroup) instances and returns a ToolBar
populated with appropriate nodes bound to the provided
actions. |
public static Action ACTION_SEPARATOR
ActionGroup for example of action tree creationpublic static Button createButton(Action action, ActionUtils.ActionTextBehavior textBehavior)
Action and returns a Button instance
with all relevant properties bound to the properties of the Action.action - The Action that the Button should bind to.textBehavior - Defines ActionUtils.ActionTextBehaviorButton that is bound to the state of the provided
Actionpublic static MenuButton createMenuButton(Action action, ActionUtils.ActionTextBehavior textBehavior)
Action and returns a MenuButton instance
with all relevant properties bound to the properties of the Action.action - The Action that the MenuButton should bind to.textBehavior - Defines ActionUtils.ActionTextBehaviorMenuButton that is bound to the state of the provided
Actionpublic static MenuButton createMenuButton(Action action)
Action and returns a MenuButton instance
with all relevant properties bound to the properties of the Action.action - The Action that the MenuButton should bind to.MenuButton that is bound to the state of the provided
Actionpublic static ToggleButton createToggleButton(Action action, ActionUtils.ActionTextBehavior textBehavior)
Action and returns a ToggleButton instance
with all relevant properties bound to the properties of the Action.action - The Action that the ToggleButton should bind to.textBehavior - Defines ActionUtils.ActionTextBehaviorToggleButton that is bound to the state of the provided
Actionpublic static ToggleButton createToggleButton(Action action)
Action and returns a ToggleButton instance
with all relevant properties bound to the properties of the Action.action - The Action that the ToggleButton should bind to.ToggleButton that is bound to the state of the provided
Actionpublic static SegmentedButton createSegmentedButton(ActionUtils.ActionTextBehavior textBehavior, Collection<? extends Action> actions)
Collection of Action and returns a SegmentedButton instance
with all relevant properties bound to the properties of the actions.actions - The Collection of Action that the SegmentedButton should bind to.textBehavior - Defines ActionUtils.ActionTextBehaviorSegmentedButton that is bound to the state of the provided Actionspublic static SegmentedButton createSegmentedButton(Collection<? extends Action> actions)
Collection of Action and returns a SegmentedButton instance
with all relevant properties bound to the properties of the actions.actions - The Collection of Action that the SegmentedButton should bind to.SegmentedButton that is bound to the state of the provided Actionspublic static SegmentedButton createSegmentedButton(ActionUtils.ActionTextBehavior textBehavior, Action... actions)
Action and returns a SegmentedButton instance
with all relevant properties bound to the properties of the actions.actions - A varargs array of Action that the SegmentedButton should bind to.textBehavior - Defines ActionUtils.ActionTextBehaviorSegmentedButton that is bound to the state of the provided Actionspublic static SegmentedButton createSegmentedButton(Action... actions)
Action and returns a SegmentedButton instance
with all relevant properties bound to the properties of the actions.actions - A varargs array of Action that the SegmentedButton should bind to.SegmentedButton that is bound to the state of the provided Actionspublic static RadioButton createRadioButton(Action action)
Action and returns a RadioButton instance
with all relevant properties bound to the properties of the Action.action - The Action that the RadioButton should bind to.RadioButton that is bound to the state of the provided
Actionpublic static CheckMenuItem createCheckMenuItem(Action action)
Action and returns a CheckMenuItem instance
with all relevant properties bound to the properties of the Action.action - The Action that the CheckMenuItem should bind to.CheckMenuItem that is bound to the state of the provided
Actionpublic static RadioMenuItem createRadioMenuItem(Action action)
Action and returns a RadioMenuItem instance
with all relevant properties bound to the properties of the Action.action - The Action that the RadioMenuItem should bind to.RadioMenuItem that is bound to the state of the provided
Actionpublic static ToolBar createToolBar(Collection<? extends Action> actions, ActionUtils.ActionTextBehavior textBehavior)
Collection of Action (or subclasses,
such as ActionGroup) instances and returns a ToolBar
populated with appropriate nodes bound to the provided
actions.public static MenuBar createMenuBar(Collection<? extends Action> actions)
Collection of Action (or subclasses,
such as ActionGroup) instances and returns a MenuBar
populated with appropriate nodes bound to the provided
actions.public static ButtonBar createButtonBar(Collection<? extends Action> actions)
Collection of Action (or subclasses,
such as ActionGroup) instances and returns a ButtonBar
populated with appropriate nodes bound to the provided
actions.public static ContextMenu createContextMenu(Collection<? extends Action> actions)
Collection of Action (or subclasses,
such as ActionGroup) instances and returns a ContextMenu
populated with appropriate nodes bound to the provided
actions.actions - The actions to place on the ContextMenu.ContextMenu that contains nodes which are bound
to the state of the provided Action