public abstract class AbstractAction extends Object implements Action
Action interface and provides
a simpler API. It is highly recommended to use this class rather than
implement the Action interface directly.
To better understand how to use actions, and where they fit within the
JavaFX ecosystem, refer to the Action class documentation.
Action| Type | Property and Description |
|---|---|
ObjectProperty<KeyCombination> |
accelerator
The accelerator
KeyCombination that should be used for this action,
if it is used in an applicable UI control (most notably MenuItem. |
BooleanProperty |
disabled
This represents whether the action should be available to the end user,
or whether it should appeared 'grayed out'.
|
ObjectProperty<Node> |
graphic
This graphic that should be shown to the user in relation to this action.
|
StringProperty |
longText
The longer form of the text to show to the user (e.g.
|
StringProperty |
text
The text to show to the user.
|
| Constructor and Description |
|---|
AbstractAction(String text)
Creates a new AbstractAction instance with the given String set as the
text value. |
| Modifier and Type | Method and Description |
|---|---|
ObjectProperty<KeyCombination> |
acceleratorProperty()
The accelerator
KeyCombination that should be used for this action,
if it is used in an applicable UI control (most notably MenuItem. |
BooleanProperty |
disabledProperty()
This represents whether the action should be available to the end user,
or whether it should appeared 'grayed out'.
|
abstract void |
execute(ActionEvent ae)
This method is called when the user selects this action.
|
KeyCombination |
getAccelerator()
Gets the value of the property accelerator.
|
Node |
getGraphic()
Gets the value of the property graphic.
|
String |
getLongText()
Gets the value of the property longText.
|
ObservableMap<Object,Object> |
getProperties()
Returns an observable map of properties on this Action for use primarily
by application developers.
|
String |
getText()
Gets the value of the property text.
|
ObjectProperty<Node> |
graphicProperty()
This graphic that should be shown to the user in relation to this action.
|
boolean |
isDisabled()
Gets the value of the property disabled.
|
StringProperty |
longTextProperty()
The longer form of the text to show to the user (e.g.
|
void |
setAccelerator(KeyCombination value)
Sets the value of the property accelerator.
|
void |
setDisabled(boolean value)
Sets the value of the property disabled.
|
void |
setGraphic(Node value)
Sets the value of the property graphic.
|
void |
setLongText(String value)
Sets the value of the property longText.
|
void |
setText(String value)
Sets the value of the property text.
|
StringProperty |
textProperty()
The text to show to the user.
|
public StringProperty textProperty
textProperty in interface ActionStringProperty that represents the current
text for this property, and which can be observed for changes.getText(),
setText(String)public BooleanProperty disabledProperty
disabledProperty in interface ActionBooleanProperty that represents the current
disabled state for this property, and which can be observed for
changes.isDisabled(),
setDisabled(boolean)public StringProperty longTextProperty
Button, it is usually a tooltip that should be shown to the user
if their mouse hovers over this action).longTextProperty in interface ActionStringProperty that represents the current
long text for this property, and which can be observed for changes.getLongText(),
setLongText(String)public ObjectProperty<Node> graphicProperty
graphicProperty in interface ActionObjectProperty that represents the current
graphic for this property, and which can be observed for changes.getGraphic(),
setGraphic(Node)public ObjectProperty<KeyCombination> acceleratorProperty
KeyCombination that should be used for this action,
if it is used in an applicable UI control (most notably MenuItem.acceleratorProperty in interface ActionObjectProperty that represents the current
accelerator for this property, and which can be observed for changes.getAccelerator(),
setAccelerator(KeyCombination)public StringProperty textProperty()
textProperty in interface ActionStringProperty that represents the current
text for this property, and which can be observed for changes.getText(),
setText(String)public final String getText()
public final void setText(String value)
public BooleanProperty disabledProperty()
disabledProperty in interface ActionBooleanProperty that represents the current
disabled state for this property, and which can be observed for
changes.isDisabled(),
setDisabled(boolean)public final boolean isDisabled()
public final void setDisabled(boolean value)
public StringProperty longTextProperty()
Button, it is usually a tooltip that should be shown to the user
if their mouse hovers over this action).longTextProperty in interface ActionStringProperty that represents the current
long text for this property, and which can be observed for changes.getLongText(),
setLongText(String)public final String getLongText()
public final void setLongText(String value)
public ObjectProperty<Node> graphicProperty()
graphicProperty in interface ActionObjectProperty that represents the current
graphic for this property, and which can be observed for changes.getGraphic(),
setGraphic(Node)public final Node getGraphic()
public final void setGraphic(Node value)
public ObjectProperty<KeyCombination> acceleratorProperty()
KeyCombination that should be used for this action,
if it is used in an applicable UI control (most notably MenuItem.acceleratorProperty in interface ActionObjectProperty that represents the current
accelerator for this property, and which can be observed for changes.getAccelerator(),
setAccelerator(KeyCombination)public final KeyCombination getAccelerator()
public final void setAccelerator(KeyCombination value)
public ObservableMap<Object,Object> getProperties()
getProperties in interface Actionpublic abstract void execute(ActionEvent ae)