public static final class ActionList.Action
extends java.lang.Object
Modifier and Type | Method and Description |
---|---|
javafx.scene.control.MenuItem |
asMenuItem()
Creates a new menu item for this action.
|
java.lang.Runnable |
getAction()
Gets the code that this action runs.
|
javafx.scene.Node |
getGraphic()
Gets the graphic used to display this action.
|
java.lang.String |
getName()
Gets the name of this action.
|
static ActionList.Action |
of(java.lang.String name,
java.lang.Runnable action)
Creates an action.
|
static ActionList.Action |
of(java.lang.String name,
java.lang.Runnable action,
javafx.scene.Node graphic)
Creates an action.
|
public static ActionList.Action of(java.lang.String name, java.lang.Runnable action)
name
- the name of the actionaction
- the code that the action should runpublic static ActionList.Action of(java.lang.String name, java.lang.Runnable action, javafx.scene.Node graphic)
name
- the name of the actionaction
- the code that the action should rungraphic
- an optional graphic that should be displayed in the action's menu. If null, no graphic will be
displayedpublic java.lang.String getName()
public java.lang.Runnable getAction()
public javafx.scene.Node getGraphic()
public javafx.scene.control.MenuItem asMenuItem()