Package swingtree.dialogs
Enum Class ConfirmAnswer
- All Implemented Interfaces:
Serializable,Comparable<ConfirmAnswer>,Constable
An enum representing the possible answers to a confirmation dialog.
This enum is intended to be used as part of the ConfirmDialog API
which can be accessed by calling the UIFactoryMethods.confirmation(String) factory method.
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>> -
Enum Constant Summary
Enum Constants -
Method Summary
Modifier and TypeMethodDescriptionbooleanisCancel()A convenience method equivalent tomyEnum == ConfirmAnswer.CANCEL.booleanA convenience method to check if the user selected the "cancel" option, or closed the dialog.booleanisClose()A convenience method equivalent tomyEnum == ConfirmAnswer.CLOSE.booleanisNo()A convenience method equivalent tomyEnum == ConfirmAnswer.NO.booleanisYes()A convenience method equivalent tomyEnum == ConfirmAnswer.YES.static ConfirmAnswerReturns the enum constant of this class with the specified name.static ConfirmAnswer[]values()Returns an array containing the constants of this enum class, in the order they are declared.
-
Enum Constant Details
-
YES
The user selected the "yes" option in the dialog. -
NO
The user selected the "no" option in the dialog. -
CANCEL
The user selected the "cancel" option in the dialog. -
CLOSE
The user closed the dialog without selecting any option.
-
-
Method Details
-
values
Returns an array containing the constants of this enum class, in the order they are declared.- Returns:
- an array containing the constants of this enum class, in the order they are declared
-
valueOf
Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)- Parameters:
name- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
IllegalArgumentException- if this enum class has no constant with the specified nameNullPointerException- if the argument is null
-
isYes
public boolean isYes()A convenience method equivalent tomyEnum == ConfirmAnswer.YES.- Returns:
trueif the user selected the "yes" option,falseotherwise.
-
isNo
public boolean isNo()A convenience method equivalent tomyEnum == ConfirmAnswer.NO.- Returns:
trueif the user selected the "no" option,falseotherwise.
-
isCancel
public boolean isCancel()A convenience method equivalent tomyEnum == ConfirmAnswer.CANCEL.- Returns:
trueif the user selected the "cancel" option,falseotherwise.
-
isClose
public boolean isClose()A convenience method equivalent tomyEnum == ConfirmAnswer.CLOSE.- Returns:
trueif the user selected the "close" option,falseotherwise.
-
isCancelOrClose
public boolean isCancelOrClose()A convenience method to check if the user selected the "cancel" option, or closed the dialog. This is equivalent tomyEnum == ConfirmAnswer.CANCEL || myEnum == ConfirmAnswer.CLOSE.- Returns:
trueif the user selected the "cancel" option, or they closed the dialog,falseotherwise.
-