Menu and another on a toolbar), consider
using an Action object to implement the function. An Action object provides
centralized handling of the state of action-event-firing components such as
buttons, menu items, etc. The state that an action can handle includes text,
graphic, long text (i.e. tooltip text), and disabled.
| Modifier and Type | Field and Description |
|---|---|
| private final ObjectProperty | |
| private final BooleanProperty | |
| private Consumer | |
| private final ObjectProperty | |
| private boolean | locked
Private fields |
| private final StringProperty | |
| private ObservableMap | |
| private final BooleanProperty | |
| private StringProperty | style
A string representation of the CSS style associated with this Action instance and passed to related UI controls. |
| private final ObservableList | |
| private final StringProperty |
| Access | Constructor and Description |
|---|---|
| public | |
| public | |
| public | Action(String
The string to display in the text property of controls such
as text, Consumer<ActionEvent> Button.This will be called when the ActionEvent is fired. eventHandler)Creates a new AbstractAction instance with the given String set as the
|
| Modifier and Type | Method and Description |
|---|---|
| public final ObjectProperty | Returns: An observableObjectProperty that represents the current
accelerator for this property, and which can be observed for changes.The accelerator |
| public final BooleanProperty | Returns: An observableBooleanProperty that represents the current
disabled state for this property, and which can be observed for
changes.This represents whether the action should be available to the end user, or whether it should appeared 'grayed out'. |
| public final KeyCombination | getAccelerator()
Returns: The accelerator |
| protected Consumer | |
| public final Node | |
| public final String | |
| public final synchronized ObservableMap | Returns: An observable map of properties on this Action for use primarily by application developersReturns an observable map of properties on this Action for use primarily by application developers. |
| public final String | |
| public ObservableList | getStyleClass()
A list of String identifiers which can be used to logically group Nodes, specifically for an external style engine. |
| public final String | |
| public final ObjectProperty | Returns: An observableObjectProperty that represents the current
graphic for this property, and which can be observed for changes.The graphic that should be shown to the user in relation to this action. |
| public final void | handle(ActionEvent event)
Implements javafx. Defers to the |
| public final boolean | isDisabled()
Returns: whether the action is available to the end user, or whether it should appeared 'grayed out'. |
| public final boolean | |
| protected void | |
| public final StringProperty | Returns: An observableStringProperty that represents the current
long text for this property, and which can be observed for changes.The longer form of the text to show to the user (e.g. on a
|
| public final BooleanProperty | Returns: An observableBooleanProperty that represents the current
selected state, and which can be observed for changes.Represents action's selected state. |
| public final void | setAccelerator(KeyCombination value)
Sets the accelerator |
| public final void | setDisabled(boolean value)
Sets whether the action should be available to the end user, or whether it should appeared 'grayed out'. |
| protected void | |
| public final void | |
| public final void | |
| public final void | |
| public final void | |
| public final void | |
| public final StringProperty | |
| public final StringProperty | Returns: An observableStringProperty that represents the current
text for this property, and which can be observed for changes.The text to show to the user. |
| acceleratorProperty | back to summary |
|---|---|
| private final ObjectProperty<KeyCombination> acceleratorProperty | |
| disabledProperty | back to summary |
|---|---|
| private final BooleanProperty disabledProperty | |
| eventHandler | back to summary |
|---|---|
| private Consumer<ActionEvent> eventHandler | |
| graphicProperty | back to summary |
|---|---|
| private final ObjectProperty<Node> graphicProperty | |
| locked | back to summary |
|---|---|
| private boolean locked Private fields | |
| longTextProperty | back to summary |
|---|---|
| private final StringProperty longTextProperty | |
| props | back to summary |
|---|---|
| private ObservableMap<Object, Object> props | |
| selectedProperty | back to summary |
|---|---|
| private final BooleanProperty selectedProperty | |
| style | back to summary |
|---|---|
| private StringProperty style A string representation of the CSS style associated with this Action instance and passed to related UI controls. This is analogous to the "style" attribute of an HTML element. Note that, like the HTML style attribute, this variable contains style properties and values and not the selector portion of a style rule. Parsing this style might not be supported on some limited platforms. It is recommended to use a standalone CSS file instead. | |
| styleClass | back to summary |
|---|---|
| private final ObservableList<String> styleClass | |
| textProperty | back to summary |
|---|---|
| private final StringProperty textProperty | |
| Action | back to summary |
|---|---|
| public Action(String text) Constructors | |
| Action | back to summary |
|---|---|
| public Action(Consumer<ActionEvent> eventHandler) | |
| Action | back to summary |
|---|---|
| public Action(String text, Consumer<ActionEvent> eventHandler) Creates a new AbstractAction instance with the given String set as the
| |
| acceleratorProperty | back to summary |
|---|---|
| public final ObjectProperty The accelerator
| |
| disabledProperty | back to summary |
|---|---|
| public final BooleanProperty disabledProperty() This represents whether the action should be available to the end user, or whether it should appeared 'grayed out'.
| |
| getAccelerator | back to summary |
|---|---|
public final KeyCombination getAccelerator()
| |
| getEventHandler | back to summary |
|---|---|
| protected Consumer | |
| getGraphic | back to summary |
|---|---|
public final Node getGraphic()
| |
| getLongText | back to summary |
|---|---|
public final String getLongText()
| |
| getProperties | back to summary |
|---|---|
| public final synchronized ObservableMap Returns an observable map of properties on this Action for use primarily by application developers.
| |
| getStyle | back to summary |
|---|---|
| public final String getStyle() | |
| getStyleClass | back to summary |
|---|---|
| public ObservableList A list of String identifiers which can be used to logically group Nodes, specifically for an external style engine. This variable is analogous to the "class" attribute on an HTML element and, as such, each element of the list is a style class to which this Node belongs.
| |
| getText | back to summary |
|---|---|
public final String getText()
| |
| graphicProperty | back to summary |
|---|---|
| public final ObjectProperty The graphic that should be shown to the user in relation to this action.
| |
| handle | back to summary |
|---|---|
| public final void handle(ActionEvent event) Implements javafx. Defers to the
| |
| isDisabled | back to summary |
|---|---|
public final boolean isDisabled()
| |
| isSelected | back to summary |
|---|---|
| public final boolean isSelected() Selected state of the Action.
| |
| lock | back to summary |
|---|---|
| protected void lock() | |
| longTextProperty | back to summary |
|---|---|
| public final StringProperty longTextProperty() The longer form of the text to show to the user (e.g. on a
| |
| selectedProperty | back to summary |
|---|---|
| public final BooleanProperty selectedProperty() Represents action's selected state. Usually bound to selected state of components such as Toggle Buttons, CheckBOxes etc
| |
| setAccelerator | back to summary |
|---|---|
| public final void setAccelerator(KeyCombination value) Sets the accelerator | |
| setDisabled | back to summary |
|---|---|
| public final void setDisabled(boolean value) Sets whether the action should be available to the end user, or whether it should appeared 'grayed out'. | |
| setEventHandler | back to summary |
|---|---|
| protected void setEventHandler(Consumer<ActionEvent> eventHandler) | |
| setGraphic | back to summary |
|---|---|
| public final void setGraphic(Node value) Sets the graphic that should be shown to the user in relation to this action. | |
| setLongText | back to summary |
|---|---|
| public final void setLongText(String value) Sets the longer form of the text to show to the user
| |
| setSelected | back to summary |
|---|---|
| public final void setSelected(boolean selected) Sets selected state of the Action | |
| setStyle | back to summary |
|---|---|
| public final void setStyle(String value) | |
| setText | back to summary |
|---|---|
| public final void setText(String value) Sets the text of the Action. | |
| styleProperty | back to summary |
|---|---|
| public final StringProperty styleProperty() | |
| textProperty | back to summary |
|---|---|
| public final StringProperty textProperty() The text to show to the user.
| |