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.

  • Nested Class Summary

    Nested classes/interfaces inherited from class java.lang.Enum

    Enum.EnumDesc<E extends Enum<E>>
  • Enum Constant Summary

    Enum Constants
    Enum Constant
    Description
    The user selected the "cancel" option in the dialog.
    The user closed the dialog without selecting any option.
    The user selected the "no" option in the dialog.
    The user selected the "yes" option in the dialog.
  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
    A convenience method equivalent to myEnum == ConfirmAnswer.CANCEL.
    boolean
    A convenience method to check if the user selected the "cancel" option, or closed the dialog.
    boolean
    A convenience method equivalent to myEnum == ConfirmAnswer.CLOSE.
    boolean
    A convenience method equivalent to myEnum == ConfirmAnswer.NO.
    boolean
    A convenience method equivalent to myEnum == ConfirmAnswer.YES.
    Returns the enum constant of this class with the specified name.
    static ConfirmAnswer[]
    Returns an array containing the constants of this enum class, in the order they are declared.

    Methods inherited from class java.lang.Object

    getClass, notify, notifyAll, wait, wait, wait
  • Enum Constant Details

    • YES

      public static final ConfirmAnswer YES
      The user selected the "yes" option in the dialog.
    • NO

      public static final ConfirmAnswer NO
      The user selected the "no" option in the dialog.
    • CANCEL

      public static final ConfirmAnswer CANCEL
      The user selected the "cancel" option in the dialog.
    • CLOSE

      public static final ConfirmAnswer CLOSE
      The user closed the dialog without selecting any option.
  • 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.