Enum EnableableItem

java.lang.Object
java.lang.Enum<EnableableItem>
bibliothek.gui.dock.common.EnableableItem
All Implemented Interfaces:
Serializable, Comparable<EnableableItem>, java.lang.constant.Constable

public enum EnableableItem extends Enum<EnableableItem>
Describes one part of a CDockable that can be disabled.
Author:
Benjamin Sigg
  • Enum Constant Details

  • Method Details

    • values

      public static EnableableItem[] values()
      Returns an array containing the constants of this enum type, in the order they are declared.
      Returns:
      an array containing the constants of this enum type, in the order they are declared
    • valueOf

      public static EnableableItem valueOf(String name)
      Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (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 type has no constant with the specified name
      NullPointerException - if the argument is null
    • getFlag

      public int getFlag()
      Gets the flag of this item, the flag is used to store a combination of several items.
      Returns:
      the flag
    • isEnabled

      public static boolean isEnabled(int flags, EnableableItem item)
      Tells whether the flags, which was created by add(int, EnableableItem) and remove(int, EnableableItem), contains item.
      Parameters:
      flags - the flags that are enabled
      item - the item to test
      Returns:
      whether item is enabled
    • add

      public static int add(int flags, EnableableItem item)
      Adds item to the flags and returns a new flag.
      Parameters:
      flags - the enabled items
      item - the item that should be enabled too
      Returns:
      the new flag including flags and item
    • remove

      public static int remove(int flags, EnableableItem item)
      Removes item from flags and returns a new flag.
      Parameters:
      flags - the enabled items
      item - the item that should no longer be enabled
      Returns:
      the new flag including flags except item