java.lang.Object
javafx.scene.control.ButtonType
The ButtonType class is used as part of the JavaFX
Dialog
API (more
specifically, the DialogPane
API) to specify which buttons should be
shown to users in the dialogs. Refer to the DialogPane
class javadoc
for more information on how to use this class.- Since:
- JavaFX 8u40
- See Also:
-
Field Summary
Modifier and TypeFieldDescriptionstatic final ButtonType
A pre-definedButtonType
that displays "Apply" and has aButtonBar.ButtonData
ofButtonBar.ButtonData.APPLY
.static final ButtonType
A pre-definedButtonType
that displays "Cancel" and has aButtonBar.ButtonData
ofButtonBar.ButtonData.CANCEL_CLOSE
.static final ButtonType
A pre-definedButtonType
that displays "Close" and has aButtonBar.ButtonData
ofButtonBar.ButtonData.CANCEL_CLOSE
.static final ButtonType
A pre-definedButtonType
that displays "Finish" and has aButtonBar.ButtonData
ofButtonBar.ButtonData.FINISH
.static final ButtonType
A pre-definedButtonType
that displays "Next" and has aButtonBar.ButtonData
ofButtonBar.ButtonData.NEXT_FORWARD
.static final ButtonType
A pre-definedButtonType
that displays "No" and has aButtonBar.ButtonData
ofButtonBar.ButtonData.NO
.static final ButtonType
A pre-definedButtonType
that displays "OK" and has aButtonBar.ButtonData
ofButtonBar.ButtonData.OK_DONE
.static final ButtonType
A pre-definedButtonType
that displays "Previous" and has aButtonBar.ButtonData
ofButtonBar.ButtonData.BACK_PREVIOUS
.static final ButtonType
A pre-definedButtonType
that displays "Yes" and has aButtonBar.ButtonData
ofButtonBar.ButtonData.YES
. -
Constructor Summary
ConstructorDescriptionButtonType
(String text) Creates a ButtonType instance with the given text, and the ButtonData set asButtonBar.ButtonData.OTHER
.ButtonType
(String text, ButtonBar.ButtonData buttonData) Creates a ButtonType instance with the given text, and the ButtonData set as specified. -
Method Summary
Modifier and TypeMethodDescriptionfinal ButtonBar.ButtonData
Returns the ButtonData specified for this ButtonType in the constructor.final String
getText()
Returns the text specified for this ButtonType in the constructor.
-
Field Details
-
APPLY
A pre-definedButtonType
that displays "Apply" and has aButtonBar.ButtonData
ofButtonBar.ButtonData.APPLY
. -
OK
A pre-definedButtonType
that displays "OK" and has aButtonBar.ButtonData
ofButtonBar.ButtonData.OK_DONE
. -
CANCEL
A pre-definedButtonType
that displays "Cancel" and has aButtonBar.ButtonData
ofButtonBar.ButtonData.CANCEL_CLOSE
. -
CLOSE
A pre-definedButtonType
that displays "Close" and has aButtonBar.ButtonData
ofButtonBar.ButtonData.CANCEL_CLOSE
. -
YES
A pre-definedButtonType
that displays "Yes" and has aButtonBar.ButtonData
ofButtonBar.ButtonData.YES
. -
NO
A pre-definedButtonType
that displays "No" and has aButtonBar.ButtonData
ofButtonBar.ButtonData.NO
. -
FINISH
A pre-definedButtonType
that displays "Finish" and has aButtonBar.ButtonData
ofButtonBar.ButtonData.FINISH
. -
NEXT
A pre-definedButtonType
that displays "Next" and has aButtonBar.ButtonData
ofButtonBar.ButtonData.NEXT_FORWARD
. -
PREVIOUS
A pre-definedButtonType
that displays "Previous" and has aButtonBar.ButtonData
ofButtonBar.ButtonData.BACK_PREVIOUS
.
-
-
Constructor Details
-
ButtonType
Creates a ButtonType instance with the given text, and the ButtonData set asButtonBar.ButtonData.OTHER
.- Parameters:
text
- The string to display in the text property of controls such asButton
.
-
ButtonType
Creates a ButtonType instance with the given text, and the ButtonData set as specified.- Parameters:
text
- The string to display in the text property of controls such asButton
.buttonData
- The type of button that should be created from this ButtonType.
-
-
Method Details
-
getButtonData
Returns the ButtonData specified for this ButtonType in the constructor.- Returns:
- the ButtonData specified for this ButtonType in the constructor
-
getText
Returns the text specified for this ButtonType in the constructor.- Returns:
- the text specified for this ButtonType in the constructor
-