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
-
Method Summary
Modifier and TypeMethodDescriptionboolean
isCancel()
A convenience method equivalent tomyEnum == ConfirmAnswer.CANCEL
.boolean
A convenience method to check if the user selected the "cancel" option, or closed the dialog.boolean
isClose()
A convenience method equivalent tomyEnum == ConfirmAnswer.CLOSE
.boolean
isNo()
A convenience method equivalent tomyEnum == ConfirmAnswer.NO
.boolean
isYes()
A convenience method equivalent tomyEnum == ConfirmAnswer.YES
.static ConfirmAnswer
Returns 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
-
NO
-
CANCEL
-
CLOSE
-
-
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:
true
if the user selected the "yes" option,false
otherwise.
-
isNo
public boolean isNo()A convenience method equivalent tomyEnum == ConfirmAnswer.NO
.- Returns:
true
if the user selected the "no" option,false
otherwise.
-
isCancel
public boolean isCancel()A convenience method equivalent tomyEnum == ConfirmAnswer.CANCEL
.- Returns:
true
if the user selected the "cancel" option,false
otherwise.
-
isClose
public boolean isClose()A convenience method equivalent tomyEnum == ConfirmAnswer.CLOSE
.- Returns:
true
if the user selected the "close" option,false
otherwise.
-
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:
true
if the user selected the "cancel" option, or they closed the dialog,false
otherwise.
-