Package limn.backend

Enum Class ClosePolicy

java.lang.Object
java.lang.Enum<ClosePolicy>
limn.backend.ClosePolicy
All Implemented Interfaces:
Serializable, Comparable<ClosePolicy>, Constable

public enum ClosePolicy extends Enum<ClosePolicy>
What a user's close of a window does once it is allowed: set with NativeWindow.setClosePolicy(limn.backend.ClosePolicy), DISPOSE by default.

Whether the close is allowed is a separate question, the window's handler's, so a window can both ask and hide. A program's NativeWindow.requestClose() is not a user's close: it disposes the window whatever the policy says.

A 1.x minor release may add constants to this enum: a switch over it needs a default branch.

  • Enum Constant Details

    • DISPOSE

      public static final ClosePolicy DISPOSE
      The window is destroyed. The default.
    • HIDE

      public static final ClosePolicy HIDE
      The window is hidden and kept, to be shown again with NativeWindow.show(). A hidden window is still an open one, so under LoopLifetime.UNTIL_LAST_WINDOW it keeps the loop running.
    • END_APPLICATION

      public static final ClosePolicy END_APPLICATION
      The close asks to end the whole application instead, as Backend.requestQuit() does: every window is asked, this one among them, and nothing closes unless all agree.
  • Method Details

    • values

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