- java.lang.Object
- 
- org.controlsfx.control.action.ActionUtils
 
- 
 public class ActionUtils extends Object Convenience class for users of theActionAPI. 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 Collectionofactions. In these cases, it is likely they are designed to work withaction groups. For examples on how to work with these methods, refer to theActionGroupclass documentation.- See Also:
- Action,- ActionGroup
 
- 
- 
Nested Class SummaryNested Classes Modifier and Type Class Description static classActionUtils.ActionTextBehaviorAction text behavior.
 - 
Field SummaryFields Modifier and Type Field Description static ActionACTION_SEPARATORAction representation of the generic separator.static ActionACTION_SPAN
 - 
Method SummaryAll Methods Static Methods Concrete Methods Modifier and Type Method Description static ButtonBaseconfigureButton(Action action, ButtonBase button)static ButtonBaseconfigureButton(Action action, ButtonBase button, ActionUtils.ActionTextBehavior textBehavior)static MenuItemconfigureMenuItem(Action action, MenuItem menuItem)static ButtoncreateButton(Action action)static ButtoncreateButton(Action action, ActionUtils.ActionTextBehavior textBehavior)static ButtonBarcreateButtonBar(Collection<? extends Action> actions)Takes the providedCollectionofAction(or subclasses, such asActionGroup) instances and returns aButtonBarpopulated with appropriatenodesbound to the providedactions.static CheckBoxcreateCheckBox(Action action)static CheckMenuItemcreateCheckMenuItem(Action action)Takes the providedActionand returns aCheckMenuIteminstance with all relevant properties bound to the properties of the Action.static ContextMenucreateContextMenu(Collection<? extends Action> actions)Takes the providedCollectionofAction(or subclasses, such asActionGroup) instances and returns aContextMenupopulated with appropriatenodesbound to the providedactions.static HyperlinkcreateHyperlink(Action action)static MenucreateMenu(Action action)static MenuBarcreateMenuBar(Collection<? extends Action> actions)Takes the providedCollectionofAction(or subclasses, such asActionGroup) instances and returns aMenuBarpopulated with appropriatenodesbound to the providedactions.static MenuButtoncreateMenuButton(Action action)Takes the providedActionand returns aMenuButtoninstance with all relevant properties bound to the properties of the Action.static MenuButtoncreateMenuButton(Action action, ActionUtils.ActionTextBehavior textBehavior)Takes the providedActionand returns aMenuButtoninstance with all relevant properties bound to the properties of the Action.static MenuItemcreateMenuItem(Action action)static RadioButtoncreateRadioButton(Action action)Takes the providedActionand returns aRadioButtoninstance with all relevant properties bound to the properties of the Action.static RadioMenuItemcreateRadioMenuItem(Action action)Takes the providedActionand returns aRadioMenuIteminstance with all relevant properties bound to the properties of the Action.static SegmentedButtoncreateSegmentedButton(Collection<? extends Action> actions)Takes the providedCollectionofActionand returns aSegmentedButtoninstance with all relevant properties bound to the properties of the actions.static SegmentedButtoncreateSegmentedButton(Action... actions)Takes the provided varargs array ofActionand returns aSegmentedButtoninstance with all relevant properties bound to the properties of the actions.static SegmentedButtoncreateSegmentedButton(ActionUtils.ActionTextBehavior textBehavior, Collection<? extends Action> actions)Takes the providedCollectionofActionand returns aSegmentedButtoninstance with all relevant properties bound to the properties of the actions.static SegmentedButtoncreateSegmentedButton(ActionUtils.ActionTextBehavior textBehavior, Action... actions)Takes the provided varargs array ofActionand returns aSegmentedButtoninstance with all relevant properties bound to the properties of the actions.static ToggleButtoncreateToggleButton(Action action)Takes the providedActionand returns aToggleButtoninstance with all relevant properties bound to the properties of the Action.static ToggleButtoncreateToggleButton(Action action, ActionUtils.ActionTextBehavior textBehavior)Takes the providedActionand returns aToggleButtoninstance with all relevant properties bound to the properties of the Action.static ToolBarcreateToolBar(Collection<? extends Action> actions, ActionUtils.ActionTextBehavior textBehavior)Takes the providedCollectionofAction(or subclasses, such asActionGroup) instances and returns aToolBarpopulated with appropriatenodesbound to the providedactions.static voidunconfigureButton(ButtonBase button)Removes all bindings and listeners which were added when the suppliedButtonBasewas bound to anActionvia one of the methods of this class.static voidunconfigureMenuItem(MenuItem menuItem)static ButtonBarupdateButtonBar(ButtonBar buttonBar, Collection<? extends Action> actions)Takes the providedCollectionofAction(or subclasses, such asActionGroup) instances and updates aButtonBarpopulated with appropriatenodesbound to the providedactions.static ContextMenuupdateContextMenu(ContextMenu menu, Collection<? extends Action> actions)Takes the providedCollectionofAction(or subclasses, such asActionGroup) instances and updates aContextMenupopulated with appropriatenodesbound to the providedactions.static MenuBarupdateMenuBar(MenuBar menuBar, Collection<? extends Action> actions)Takes the providedCollectionofAction(or subclasses, such asActionGroup) instances and updates aMenuBarpopulated with appropriatenodesbound to the providedactions.static ToolBarupdateToolBar(ToolBar toolbar, Collection<? extends Action> actions, ActionUtils.ActionTextBehavior textBehavior)Takes the providedCollectionofAction(or subclasses, such asActionGroup) instances and returns providedToolBarpopulated with appropriatenodesbound to the providedactions.
 
- 
- 
- 
Field Detail- 
ACTION_SEPARATORpublic static Action ACTION_SEPARATOR Action representation of the generic separator. Adding this action anywhere in the action tree serves as indication that separator has be created in its place. SeeActionGroupfor example of action tree creation
 - 
ACTION_SPANpublic static Action ACTION_SPAN 
 
- 
 - 
Method Detail- 
createButtonpublic static Button createButton(Action action, ActionUtils.ActionTextBehavior textBehavior) Takes the providedActionand returns aButtoninstance with all relevant properties bound to the properties of the Action.- Parameters:
- action- The- Actionthat the- Buttonshould bind to.
- textBehavior- Defines- ActionUtils.ActionTextBehavior
- Returns:
- A Buttonthat is bound to the state of the providedAction
 
 - 
configureButtonpublic static ButtonBase configureButton(Action action, ButtonBase button, ActionUtils.ActionTextBehavior textBehavior) Takes the providedActionand binds the relevant properties to the suppliedButton. This allows for the use of Actions within custom Button subclasses.- Parameters:
- action- The- Actionthat the- Buttonshould bind to.
- button- The- ButtonBasethat the- Actionshould be bound to.
- textBehavior- Defines- ActionUtils.ActionTextBehavior
- Returns:
- The ButtonBasethat was bound to theAction.
 
 - 
configureButtonpublic static ButtonBase configureButton(Action action, ButtonBase button) Takes the providedActionand binds the relevant properties to the suppliedButton. This allows for the use of Actions within custom Button subclasses.- Parameters:
- action- The- Actionthat the- Buttonshould bind to.
- button- The- ButtonBasethat the- Actionshould be bound to.
- Returns:
- The ButtonBasethat was bound to theAction.
 
 - 
unconfigureButtonpublic static void unconfigureButton(ButtonBase button) Removes all bindings and listeners which were added when the suppliedButtonBasewas bound to anActionvia one of the methods of this class.- Parameters:
- button- a- ButtonBasethat was bound to an- Action
 
 - 
createMenuButtonpublic static MenuButton createMenuButton(Action action, ActionUtils.ActionTextBehavior textBehavior) Takes the providedActionand returns aMenuButtoninstance with all relevant properties bound to the properties of the Action.- Parameters:
- action- The- Actionthat the- MenuButtonshould bind to.
- textBehavior- Defines- ActionUtils.ActionTextBehavior
- Returns:
- A MenuButtonthat is bound to the state of the providedAction
 
 - 
createMenuButtonpublic static MenuButton createMenuButton(Action action) Takes the providedActionand returns aMenuButtoninstance with all relevant properties bound to the properties of the Action.- Parameters:
- action- The- Actionthat the- MenuButtonshould bind to.
- Returns:
- A MenuButtonthat is bound to the state of the providedAction
 
 - 
createToggleButtonpublic static ToggleButton createToggleButton(Action action, ActionUtils.ActionTextBehavior textBehavior) Takes the providedActionand returns aToggleButtoninstance with all relevant properties bound to the properties of the Action.- Parameters:
- action- The- Actionthat the- ToggleButtonshould bind to.
- textBehavior- Defines- ActionUtils.ActionTextBehavior
- Returns:
- A ToggleButtonthat is bound to the state of the providedAction
 
 - 
createToggleButtonpublic static ToggleButton createToggleButton(Action action) Takes the providedActionand returns aToggleButtoninstance with all relevant properties bound to the properties of the Action.- Parameters:
- action- The- Actionthat the- ToggleButtonshould bind to.
- Returns:
- A ToggleButtonthat is bound to the state of the providedAction
 
 - 
createSegmentedButtonpublic static SegmentedButton createSegmentedButton(ActionUtils.ActionTextBehavior textBehavior, Collection<? extends Action> actions) Takes the providedCollectionofActionand returns aSegmentedButtoninstance with all relevant properties bound to the properties of the actions.- Parameters:
- actions- The- Collectionof- Actionthat the- SegmentedButtonshould bind to.
- textBehavior- Defines- ActionUtils.ActionTextBehavior
- Returns:
- A SegmentedButtonthat is bound to the state of the providedActions
 
 - 
createSegmentedButtonpublic static SegmentedButton createSegmentedButton(Collection<? extends Action> actions) Takes the providedCollectionofActionand returns aSegmentedButtoninstance with all relevant properties bound to the properties of the actions.- Parameters:
- actions- The- Collectionof- Actionthat the- SegmentedButtonshould bind to.
- Returns:
- A SegmentedButtonthat is bound to the state of the providedActions
 
 - 
createSegmentedButtonpublic static SegmentedButton createSegmentedButton(ActionUtils.ActionTextBehavior textBehavior, Action... actions) Takes the provided varargs array ofActionand returns aSegmentedButtoninstance with all relevant properties bound to the properties of the actions.- Parameters:
- actions- A varargs array of- Actionthat the- SegmentedButtonshould bind to.
- textBehavior- Defines- ActionUtils.ActionTextBehavior
- Returns:
- A SegmentedButtonthat is bound to the state of the providedActions
 
 - 
createSegmentedButtonpublic static SegmentedButton createSegmentedButton(Action... actions) Takes the provided varargs array ofActionand returns aSegmentedButtoninstance with all relevant properties bound to the properties of the actions.- Parameters:
- actions- A varargs array of- Actionthat the- SegmentedButtonshould bind to.
- Returns:
- A SegmentedButtonthat is bound to the state of the providedActions
 
 - 
createRadioButtonpublic static RadioButton createRadioButton(Action action) Takes the providedActionand returns aRadioButtoninstance with all relevant properties bound to the properties of the Action.- Parameters:
- action- The- Actionthat the- RadioButtonshould bind to.
- Returns:
- A RadioButtonthat is bound to the state of the providedAction
 
 - 
unconfigureMenuItempublic static void unconfigureMenuItem(MenuItem menuItem) 
 - 
createCheckMenuItempublic static CheckMenuItem createCheckMenuItem(Action action) Takes the providedActionand returns aCheckMenuIteminstance with all relevant properties bound to the properties of the Action.- Parameters:
- action- The- Actionthat the- CheckMenuItemshould bind to.
- Returns:
- A CheckMenuItemthat is bound to the state of the providedAction
 
 - 
createRadioMenuItempublic static RadioMenuItem createRadioMenuItem(Action action) Takes the providedActionand returns aRadioMenuIteminstance with all relevant properties bound to the properties of the Action.- Parameters:
- action- The- Actionthat the- RadioMenuItemshould bind to.
- Returns:
- A RadioMenuItemthat is bound to the state of the providedAction
 
 - 
createToolBarpublic static ToolBar createToolBar(Collection<? extends Action> actions, ActionUtils.ActionTextBehavior textBehavior) Takes the providedCollectionofAction(or subclasses, such asActionGroup) instances and returns aToolBarpopulated with appropriatenodesbound to the providedactions.
 - 
updateToolBarpublic static ToolBar updateToolBar(ToolBar toolbar, Collection<? extends Action> actions, ActionUtils.ActionTextBehavior textBehavior) Takes the providedCollectionofAction(or subclasses, such asActionGroup) instances and returns providedToolBarpopulated with appropriatenodesbound to the providedactions. Previous toolbar content is removed
 - 
createMenuBarpublic static MenuBar createMenuBar(Collection<? extends Action> actions) Takes the providedCollectionofAction(or subclasses, such asActionGroup) instances and returns aMenuBarpopulated with appropriatenodesbound to the providedactions.
 - 
updateMenuBarpublic static MenuBar updateMenuBar(MenuBar menuBar, Collection<? extends Action> actions) Takes the providedCollectionofAction(or subclasses, such asActionGroup) instances and updates aMenuBarpopulated with appropriatenodesbound to the providedactions. Previous MenuBar content is removed.
 - 
createButtonBarpublic static ButtonBar createButtonBar(Collection<? extends Action> actions) Takes the providedCollectionofAction(or subclasses, such asActionGroup) instances and returns aButtonBarpopulated with appropriatenodesbound to the providedactions.
 - 
updateButtonBarpublic static ButtonBar updateButtonBar(ButtonBar buttonBar, Collection<? extends Action> actions) Takes the providedCollectionofAction(or subclasses, such asActionGroup) instances and updates aButtonBarpopulated with appropriatenodesbound to the providedactions. Previous content of button bar is removed
 - 
createContextMenupublic static ContextMenu createContextMenu(Collection<? extends Action> actions) Takes the providedCollectionofAction(or subclasses, such asActionGroup) instances and returns aContextMenupopulated with appropriatenodesbound to the providedactions.- Parameters:
- actions- The- actionsto place on the- ContextMenu.
- Returns:
- A ContextMenuthat containsnodeswhich are bound to the state of the providedAction
 
 - 
updateContextMenupublic static ContextMenu updateContextMenu(ContextMenu menu, Collection<? extends Action> actions) Takes the providedCollectionofAction(or subclasses, such asActionGroup) instances and updates aContextMenupopulated with appropriatenodesbound to the providedactions. Previous content of context menu is removed- Parameters:
- menu- The- menuto update
- actions- The- actionsto place on the- ContextMenu.
- Returns:
- A ContextMenuthat containsnodeswhich are bound to the state of the providedAction
 
 
- 
 
-