Enum Class SGToolbarButtonType

java.lang.Object
java.lang.Enum<SGToolbarButtonType>
com.samjakob.spigui.toolbar.SGToolbarButtonType
All Implemented Interfaces:
Serializable, Comparable<SGToolbarButtonType>, Constable

public enum SGToolbarButtonType extends Enum<SGToolbarButtonType>
Represents pre-defined types for toolbar buttons. These can be used to easily re-define the buttons used in a toolbar, without creating an entirely custom toolbar implementation.
  • Enum Constant Details

    • PREV_BUTTON

      public static final SGToolbarButtonType PREV_BUTTON
      The "previous page" pagination button.
    • CURRENT_BUTTON

      public static final SGToolbarButtonType CURRENT_BUTTON
      The "current page" indicator button (doesn't necessarily have an action associated).
    • NEXT_BUTTON

      public static final SGToolbarButtonType NEXT_BUTTON
      The "next page" pagination button.
    • UNASSIGNED

      public static final SGToolbarButtonType UNASSIGNED
      No pre-defined action or button.
  • Field Details

    • DEFAULT_MAPPINGS

      private static final Map<Integer,SGToolbarButtonType> DEFAULT_MAPPINGS
      The default mappings between slot number and SGToolbarButtonType. This intended for use in setting (or falling back to) defaults for toolbar buttons, or for minor tweaks to existing buttons in a toolbar, as opposed to entirely new custom toolbars.
  • Constructor Details

    • SGToolbarButtonType

      private SGToolbarButtonType()
  • Method Details

    • values

      public static SGToolbarButtonType[] 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 SGToolbarButtonType 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
    • getDefaultForSlot

      public static SGToolbarButtonType getDefaultForSlot(int slot)
      Returns the default mapping between a given toolbar slot number (from 0 to 8), and SGToolbarButtonType. This intended for use in setting (or falling back to) defaults for toolbar buttons, or for minor tweaks to existing buttons in a toolbar, as opposed to entirely new custom toolbars.
      Parameters:
      slot - The slot number to get the default button type mapping for.
      Returns:
      The default button type mapping for the specified slot. Alternatively, UNASSIGNED if there isn't one.