Enum Class ConfirmAnswer

java.lang.Object
java.lang.Enum<ConfirmAnswer>
swingtree.dialogs.ConfirmAnswer
All Implemented Interfaces:
Serializable, Comparable<ConfirmAnswer>, Constable

public enum ConfirmAnswer extends Enum<ConfirmAnswer>
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.

  • Enum Constant Details

  • Method Details

    • values

      public static ConfirmAnswer[] 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

      public static ConfirmAnswer valueOf(String name)
      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 name
      NullPointerException - if the argument is null
    • isYes

      public boolean isYes()
      A convenience method equivalent to myEnum == ConfirmAnswer.YES.
      Returns:
      true if the user selected the "yes" option, false otherwise.
    • isNo

      public boolean isNo()
      A convenience method equivalent to myEnum == ConfirmAnswer.NO.
      Returns:
      true if the user selected the "no" option, false otherwise.
    • isCancel

      public boolean isCancel()
      A convenience method equivalent to myEnum == ConfirmAnswer.CANCEL.
      Returns:
      true if the user selected the "cancel" option, false otherwise.
    • isClose

      public boolean isClose()
      A convenience method equivalent to myEnum == 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 to myEnum == ConfirmAnswer.CANCEL || myEnum == ConfirmAnswer.CLOSE.
      Returns:
      true if the user selected the "cancel" option, or they closed the dialog, false otherwise.