Package me.hackware.api.setting
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
A
backs them with a runtime list, so the same
dropdown UI serves both without the renderer knowing the source.
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
-
Field Summary
-
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedChoiceSetting(String name) protectedChoiceSetting(String name, String description) -
Method Summary
Modifier and TypeMethodDescriptionabstract intNumber of selectable options.Label of the currently-selected option (""when none).voidAdvance to the next option, wrapping around.abstract intIndex of the currently-selected option, or-1if none.abstract StringchoiceKey(int index) Stable persistence key for the option atindex(slugged by the config layer).abstract StringchoiceLabel(int index) Human-readable label for the option atindex.abstract voidchoiceSelect(int index) Select the option atindex.Methods inherited from class me.hackware.api.setting.Setting
defaultValue, description, displayName, get, getDefaultValue, getDescription, getDisplayName, getGroup, getName, getOwner, group, isBulkLoading, isVisible, onChanged, setBulkLoadProbe, setOwner, setValue, visible, visible
-
Constructor Details
-
ChoiceSetting
-
ChoiceSetting
-
-
Method Details
-
choiceCount
public abstract int choiceCount()Number of selectable options. -
choiceLabel
Human-readable label for the option atindex. -
choiceKey
Stable persistence key for the option atindex(slugged by the config layer). -
choiceIndex
public abstract int choiceIndex()Index of the currently-selected option, or-1if none. -
choiceSelect
public abstract void choiceSelect(int index) Select the option atindex. -
choiceCycle
public void choiceCycle()Advance to the next option, wrapping around. -
choiceCurrentLabel
Label of the currently-selected option (""when none).
-