Class ChoiceSetting<T>

java.lang.Object
me.hackware.api.setting.Setting<T>
me.hackware.api.setting.ChoiceSetting<T>
Type Parameters:
T - the stored value type
Direct Known Subclasses:
EnumSetting

public abstract class ChoiceSetting<T> extends Setting<T>
A Setting whose value is one option chosen from an ordered list — the model behind the ClickGUI dropdown. EnumSetting backs the options with enum constants;
invalid reference
ThemeSetting
backs them with a runtime list, so the same dropdown UI serves both without the renderer knowing the source.
  • Constructor Details

    • ChoiceSetting

      protected ChoiceSetting(String name)
    • ChoiceSetting

      protected ChoiceSetting(String name, String description)
  • Method Details

    • choiceCount

      public abstract int choiceCount()
      Number of selectable options.
    • choiceLabel

      public abstract String choiceLabel(int index)
      Human-readable label for the option at index.
    • choiceKey

      public abstract String choiceKey(int index)
      Stable persistence key for the option at index (slugged by the config layer).
    • choiceIndex

      public abstract int choiceIndex()
      Index of the currently-selected option, or -1 if none.
    • choiceSelect

      public abstract void choiceSelect(int index)
      Select the option at index.
    • choiceCycle

      public void choiceCycle()
      Advance to the next option, wrapping around.
    • choiceCurrentLabel

      public String choiceCurrentLabel()
      Label of the currently-selected option ("" when none).