Top Description Inners Fields Constructors Methods
org.controlsfx.control.action

public Class ActionUtils

extends Object
Class Inheritance
Annotations
@SuppressWarnings:deprecation
Imports
javafx.beans.InvalidationListener, javafx.beans.binding.ObjectBinding, .StringBinding, .When, javafx.collections.FXCollections, .ListChangeListener, .MapChangeListener, .ObservableList, javafx.css.Styleable, javafx.scene.Node, javafx.scene.control.*, javafx.scene.image.ImageView, javafx.scene.layout.HBox, .Pane, .Priority, .VBox, org.controlsfx.control.SegmentedButton, org.controlsfx.tools.Duplicatable, java.lang.ref.WeakReference, java.util.ArrayList, .Arrays, .Collection

Convenience class for users of the 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.

See Also
Action, ActionGroup

Nested and Inner Type Summary

Modifier and TypeClass and Description
public static enum
ActionUtils.ActionTextBehavior

Action text behavior.

private static class

Field Summary

Modifier and TypeField and Description
public static Action
ACTION_SEPARATOR

Action representation of the generic separator.

public static Action

Constructor Summary

AccessConstructor and Description
private
ActionUtils()

* Constructors * *

Method Summary

Modifier and TypeMethod and Description
private static void
bindStyle(final Styleable styleable, final Action action)

private static <T extends ButtonBase> T
configure(final T btn, final Action action, final ActionUtils.ActionTextBehavior textBehavior)

private static <T extends MenuItem> T
configure(final T menuItem, final Action action)

public static ButtonBase

Returns:

The ButtonBase that was bound to the Action.
configureButton
(final Action
The Action that the Button should bind to.
action
,
ButtonBase
The ButtonBase that the Action should be bound to.
button
,
final ActionUtils.ActionTextBehavior textBehavior)

Takes the provided Action and binds the relevant properties to the supplied Button.

public static ButtonBase

Returns:

The ButtonBase that was bound to the Action.
configureButton
(final Action
The Action that the Button should bind to.
action
,
ButtonBase
The ButtonBase that the Action should be bound to.
button
)

Takes the provided Action and binds the relevant properties to the supplied Button.

public static MenuItem
configureMenuItem(final Action action, MenuItem menuItem)

private static Node
copyNode(Node node)

public static Button

Returns:

A Button that is bound to the state of the provided Action
createButton
(final Action
The Action that the Button should bind to.
action
,
final ActionUtils.ActionTextBehavior textBehavior)

Takes the provided Action and returns a Button instance with all relevant properties bound to the properties of the Action.

public static Button

Returns:

A Button that is bound to the state of the provided Action
createButton
(final Action
The Action that the Button should bind to.
action
)

Takes the provided Action and returns a Button instance with all relevant properties bound to the properties of the Action.

public static ButtonBar

Returns:

A ButtonBar that contains nodes which are bound to the state of the provided Action
createButtonBar
(Collection<? extends Action>
The actions to place on the ButtonBar.
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.

public static CheckBox

Returns:

A CheckBox that is bound to the state of the provided Action
createCheckBox
(final Action
The Action that the CheckBox should bind to.
action
)

Takes the provided Action and returns a CheckBox instance with all relevant properties bound to the properties of the Action.

public static CheckMenuItem

Returns:

A CheckMenuItem that is bound to the state of the provided Action
createCheckMenuItem
(final Action
The Action that the CheckMenuItem should bind to.
action
)

Takes the provided Action and returns a CheckMenuItem instance with all relevant properties bound to the properties of the Action.

public static ContextMenu

Returns:

A ContextMenu that contains nodes which are bound to the state of the provided Action
createContextMenu
(Collection<? extends Action>
The actions to place on the ContextMenu.
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.

public static Menu

Returns:

A Menu that is bound to the state of the provided Action
createMenu
(final Action
The Action that the Menu should bind to.
action
)

Takes the provided Action and returns a Menu instance with all relevant properties bound to the properties of the Action.

public static MenuBar

Returns:

A MenuBar that contains nodes which are bound to the state of the provided Action
createMenuBar
(Collection<? extends Action>
The actions to place on the MenuBar.
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.

public static MenuButton

Returns:

A MenuButton that is bound to the state of the provided Action
createMenuButton
(final Action
The Action that the MenuButton should bind to.
action
,
final ActionUtils.ActionTextBehavior textBehavior)

Takes the provided Action and returns a MenuButton instance with all relevant properties bound to the properties of the Action.

public static MenuButton

Returns:

A MenuButton that is bound to the state of the provided Action
createMenuButton
(final Action
The Action that the MenuButton should bind to.
action
)

Takes the provided Action and returns a MenuButton instance with all relevant properties bound to the properties of the Action.

public static MenuItem

Returns:

A MenuItem that is bound to the state of the provided Action
createMenuItem
(final Action
The Action that the MenuItem should bind to.
action
)

Takes the provided Action and returns a MenuItem instance with all relevant properties bound to the properties of the Action.

public static RadioButton

Returns:

A RadioButton that is bound to the state of the provided Action
createRadioButton
(final Action
The Action that the RadioButton should bind to.
action
)

Takes the provided Action and returns a RadioButton instance with all relevant properties bound to the properties of the Action.

public static RadioMenuItem

Returns:

A RadioMenuItem that is bound to the state of the provided Action
createRadioMenuItem
(final Action
The Action that the RadioMenuItem should bind to.
action
)

Takes the provided Action and returns a RadioMenuItem instance with all relevant properties bound to the properties of the Action.

public static SegmentedButton

Returns:

A SegmentedButton that is bound to the state of the provided Actions
createSegmentedButton
(final ActionUtils.ActionTextBehavior textBehavior, Collection<? extends Action>
The Collection of Action that the SegmentedButton should bind to.
actions
)

Takes the provided Collection of Action and returns a SegmentedButton instance with all relevant properties bound to the properties of the actions.

public static SegmentedButton

Returns:

A SegmentedButton that is bound to the state of the provided Actions
createSegmentedButton
(Collection<? extends Action>
The Collection of Action that the SegmentedButton should bind to.
actions
)

Takes the provided Collection of Action and returns a SegmentedButton instance with all relevant properties bound to the properties of the actions.

public static SegmentedButton

Returns:

A SegmentedButton that is bound to the state of the provided Actions
createSegmentedButton
(ActionUtils.ActionTextBehavior textBehavior, Action...
A varargs array of Action that the SegmentedButton should bind to.
actions
)

Takes the provided varargs array of Action and returns a SegmentedButton instance with all relevant properties bound to the properties of the actions.

public static SegmentedButton

Returns:

A SegmentedButton that is bound to the state of the provided Actions
createSegmentedButton
(Action...
A varargs array of Action that the SegmentedButton should bind to.
actions
)

Takes the provided varargs array of Action and returns a SegmentedButton instance with all relevant properties bound to the properties of the actions.

public static ToggleButton

Returns:

A ToggleButton that is bound to the state of the provided Action
createToggleButton
(final Action
The Action that the ToggleButton should bind to.
action
,
final ActionUtils.ActionTextBehavior textBehavior)

Takes the provided Action and returns a ToggleButton instance with all relevant properties bound to the properties of the Action.

public static ToggleButton

Returns:

A ToggleButton that is bound to the state of the provided Action
createToggleButton
(final Action
The Action that the ToggleButton should bind to.
action
)

Takes the provided Action and returns a ToggleButton instance with all relevant properties bound to the properties of the Action.

public static ToolBar

Returns:

A ToolBar that contains nodes which are bound to the state of the provided Action
createToolBar
(Collection<? extends Action>
The actions to place on the ToolBar.
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.

private static Collection<MenuItem>
toMenuItems(Collection<? extends Action> actions)

* Private implementation * *

private static void
private static void
unconfigure(final MenuItem menuItem)

public static void
unconfigureButton(ButtonBase
a ButtonBase that was bound to an Action
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.

public static void
unconfigureMenuItem(final MenuItem
a MenuItem that was bound to an Action
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.

public static ButtonBar

Returns:

A ButtonBar that contains nodes which are bound to the state of the provided Action
updateButtonBar
(ButtonBar
The buttonBar to update
buttonBar
,
Collection<? extends Action>
The actions to place on the ButtonBar.
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.

public static ContextMenu

Returns:

A ContextMenu that contains nodes which are bound to the state of the provided Action
updateContextMenu
(ContextMenu
The menu to update
menu
,
Collection<? extends Action>
The actions to place on the ContextMenu.
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.

public static MenuBar

Returns:

A MenuBar that contains nodes which are bound to the state of the provided Action
updateMenuBar
(MenuBar
The menuBar to update
menuBar
,
Collection<? extends Action>
The actions to place on the MenuBar.
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.

public static ToolBar

Returns:

A ToolBar that contains nodes which are bound to the state of the provided Action
updateToolBar
(ToolBar
The toolbar to update
toolbar
,
Collection<? extends Action>
The actions to place on the ToolBar.
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.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait