public class ActionUtils
extends java.lang.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.
|
static Action |
ACTION_SPAN |
| Modifier and Type | Method and Description |
|---|---|
static javafx.scene.control.ButtonBase |
configureButton(Action action,
javafx.scene.control.ButtonBase button)
Takes the provided
Action and binds the relevant properties to
the supplied Button. |
static javafx.scene.control.ButtonBase |
configureButton(Action action,
javafx.scene.control.ButtonBase button,
ActionUtils.ActionTextBehavior textBehavior)
Takes the provided
Action and binds the relevant properties to
the supplied Button. |
static javafx.scene.control.MenuItem |
configureMenuItem(Action action,
javafx.scene.control.MenuItem menuItem) |
static javafx.scene.control.Button |
createButton(Action action)
Takes the provided
Action and returns a Button instance
with all relevant properties bound to the properties of the Action. |
static javafx.scene.control.Button |
createButton(Action action,
ActionUtils.ActionTextBehavior textBehavior)
Takes the provided
Action and returns a Button instance
with all relevant properties bound to the properties of the Action. |
static javafx.scene.control.ButtonBar |
createButtonBar(java.util.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 javafx.scene.control.CheckBox |
createCheckBox(Action action)
Takes the provided
Action and returns a CheckBox instance
with all relevant properties bound to the properties of the Action. |
static javafx.scene.control.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 javafx.scene.control.ContextMenu |
createContextMenu(java.util.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 javafx.scene.control.Hyperlink |
createHyperlink(Action action)
Takes the provided
Action and returns a Hyperlink instance
with all relevant properties bound to the properties of the Action. |
static javafx.scene.control.Menu |
createMenu(Action action)
Takes the provided
Action and returns a Menu instance
with all relevant properties bound to the properties of the Action. |
static javafx.scene.control.MenuBar |
createMenuBar(java.util.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 javafx.scene.control.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 javafx.scene.control.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 javafx.scene.control.MenuItem |
createMenuItem(Action action)
Takes the provided
Action and returns a MenuItem instance
with all relevant properties bound to the properties of the Action. |
static javafx.scene.control.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 javafx.scene.control.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,
java.util.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(java.util.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 javafx.scene.control.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 javafx.scene.control.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 javafx.scene.control.ToolBar |
createToolBar(java.util.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. |
static void |
unconfigureButton(javafx.scene.control.ButtonBase button)
Removes all bindings and listeners which were added when the supplied
ButtonBase was bound to an Action via one of the methods
of this class. |
static void |
unconfigureMenuItem(javafx.scene.control.MenuItem menuItem)
Removes all bindings and listeners which were added when the supplied
MenuItem was bound to an Action via one of the methods
of this class. |
static javafx.scene.control.ButtonBar |
updateButtonBar(javafx.scene.control.ButtonBar buttonBar,
java.util.Collection<? extends Action> actions)
Takes the provided
Collection of Action (or subclasses,
such as ActionGroup) instances and updates a ButtonBar
populated with appropriate nodes bound to the provided
actions. |
static javafx.scene.control.ContextMenu |
updateContextMenu(javafx.scene.control.ContextMenu menu,
java.util.Collection<? extends Action> actions)
Takes the provided
Collection of Action (or subclasses,
such as ActionGroup) instances and updates a ContextMenu
populated with appropriate nodes bound to the provided
actions. |
static javafx.scene.control.MenuBar |
updateMenuBar(javafx.scene.control.MenuBar menuBar,
java.util.Collection<? extends Action> actions)
Takes the provided
Collection of Action (or subclasses,
such as ActionGroup) instances and updates a MenuBar
populated with appropriate nodes bound to the provided
actions. |
static javafx.scene.control.ToolBar |
updateToolBar(javafx.scene.control.ToolBar toolbar,
java.util.Collection<? extends Action> actions,
ActionUtils.ActionTextBehavior textBehavior)
Takes the provided
Collection of Action (or subclasses,
such as ActionGroup) instances and returns provided ToolBar
populated with appropriate nodes bound to the provided
actions. |
public static Action ACTION_SEPARATOR
ActionGroup for example of action tree creationpublic static Action ACTION_SPAN
public static javafx.scene.control.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 javafx.scene.control.Button createButton(Action action)
Action and returns a Button instance
with all relevant properties bound to the properties of the Action.public static javafx.scene.control.ButtonBase configureButton(Action action, javafx.scene.control.ButtonBase button, ActionUtils.ActionTextBehavior textBehavior)
Action and binds the relevant properties to
the supplied Button. This allows for the use of Actions
within custom Button subclasses.action - The Action that the Button should bind to.button - The ButtonBase that the Action should be bound to.textBehavior - Defines ActionUtils.ActionTextBehaviorButtonBase that was bound to the Action.public static javafx.scene.control.ButtonBase configureButton(Action action, javafx.scene.control.ButtonBase button)
Action and binds the relevant properties to
the supplied Button. This allows for the use of Actions
within custom Button subclasses.public static void unconfigureButton(javafx.scene.control.ButtonBase button)
ButtonBase was bound to an Action via one of the methods
of this class.button - a ButtonBase that was bound to an Actionpublic static javafx.scene.control.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 javafx.scene.control.MenuButton createMenuButton(Action action)
Action and returns a MenuButton instance
with all relevant properties bound to the properties of the Action.public static javafx.scene.control.Hyperlink createHyperlink(Action action)
Action and returns a Hyperlink instance
with all relevant properties bound to the properties of the Action.public static javafx.scene.control.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 javafx.scene.control.ToggleButton createToggleButton(Action action)
Action and returns a ToggleButton instance
with all relevant properties bound to the properties of the Action.public static SegmentedButton createSegmentedButton(ActionUtils.ActionTextBehavior textBehavior, java.util.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(java.util.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 javafx.scene.control.CheckBox createCheckBox(Action action)
Action and returns a CheckBox instance
with all relevant properties bound to the properties of the Action.public static javafx.scene.control.RadioButton createRadioButton(Action action)
Action and returns a RadioButton instance
with all relevant properties bound to the properties of the Action.public static javafx.scene.control.MenuItem createMenuItem(Action action)
Action and returns a MenuItem instance
with all relevant properties bound to the properties of the Action.public static javafx.scene.control.MenuItem configureMenuItem(Action action, javafx.scene.control.MenuItem menuItem)
public static void unconfigureMenuItem(javafx.scene.control.MenuItem menuItem)
MenuItem was bound to an Action via one of the methods
of this class.menuItem - a MenuItem that was bound to an Actionpublic static javafx.scene.control.Menu createMenu(Action action)
Action and returns a Menu instance
with all relevant properties bound to the properties of the Action.public static javafx.scene.control.CheckMenuItem createCheckMenuItem(Action action)
Action and returns a CheckMenuItem instance
with all relevant properties bound to the properties of the Action.public static javafx.scene.control.RadioMenuItem createRadioMenuItem(Action action)
Action and returns a RadioMenuItem instance
with all relevant properties bound to the properties of the Action.public static javafx.scene.control.ToolBar createToolBar(java.util.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.actions - The actions to place on the ToolBar.textBehavior - defines ActionUtils.ActionTextBehaviorToolBar that contains nodes which are bound
to the state of the provided Actionpublic static javafx.scene.control.ToolBar updateToolBar(javafx.scene.control.ToolBar toolbar,
java.util.Collection<? extends Action> actions,
ActionUtils.ActionTextBehavior textBehavior)
Collection of Action (or subclasses,
such as ActionGroup) instances and returns provided ToolBar
populated with appropriate nodes bound to the provided
actions. Previous toolbar content is removedtoolbar - The toolbar to updateactions - The actions to place on the ToolBar.textBehavior - defines ActionUtils.ActionTextBehaviorToolBar that contains nodes which are bound
to the state of the provided Actionpublic static javafx.scene.control.MenuBar createMenuBar(java.util.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 javafx.scene.control.MenuBar updateMenuBar(javafx.scene.control.MenuBar menuBar,
java.util.Collection<? extends Action> actions)
Collection of Action (or subclasses,
such as ActionGroup) instances and updates a MenuBar
populated with appropriate nodes bound to the provided
actions. Previous MenuBar content is removed.public static javafx.scene.control.ButtonBar createButtonBar(java.util.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 javafx.scene.control.ButtonBar updateButtonBar(javafx.scene.control.ButtonBar buttonBar,
java.util.Collection<? extends Action> actions)
Collection of Action (or subclasses,
such as ActionGroup) instances and updates a ButtonBar
populated with appropriate nodes bound to the provided
actions. Previous content of button bar is removedpublic static javafx.scene.control.ContextMenu createContextMenu(java.util.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.public static javafx.scene.control.ContextMenu updateContextMenu(javafx.scene.control.ContextMenu menu,
java.util.Collection<? extends Action> actions)
Collection of Action (or subclasses,
such as ActionGroup) instances and updates a ContextMenu
populated with appropriate nodes bound to the provided
actions. Previous content of context menu is removed