Class OptionManager
- java.lang.Object
-
- com.realtime.crossfire.jxclient.settings.options.OptionManager
-
public class OptionManager extends java.lang.ObjectMaintains a set of named options.
-
-
Constructor Summary
Constructors Constructor Description OptionManager(@NotNull Settings settings)Creates a new instance.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddOption(@NotNull java.lang.String optionName, @NotNull java.lang.String documentation, @NotNull Option option)Adds a new option.@NotNull CheckBoxOptiongetCheckBoxOption(@NotNull java.lang.String optionName)Returns a check box option.voidloadOptions()Loads all options' states from the backing settings instance.voidremoveOption(@NotNull java.lang.String optionName)Removes an option by name.voidsaveOptions()Saves all options' states to the backing settings instance.
-
-
-
Constructor Detail
-
OptionManager
public OptionManager(@NotNull @NotNull Settings settings)Creates a new instance.- Parameters:
settings- the settings instance for loading/saving option values
-
-
Method Detail
-
addOption
public void addOption(@NotNull @NotNull java.lang.String optionName, @NotNull @NotNull java.lang.String documentation, @NotNull @NotNull Option option) throws OptionExceptionAdds a new option.- Parameters:
optionName- the option name to adddocumentation- the documentation string for the settingsoption- the option to add- Throws:
OptionException- if the option name is not unique
-
removeOption
public void removeOption(@NotNull @NotNull java.lang.String optionName)Removes an option by name. Does nothing if the option does not exist.- Parameters:
optionName- the option name to remove
-
getCheckBoxOption
@NotNull public @NotNull CheckBoxOption getCheckBoxOption(@NotNull @NotNull java.lang.String optionName) throws OptionException
Returns a check box option.- Parameters:
optionName- the option name to look up- Returns:
- the option
- Throws:
OptionException- if the option name does not exist
-
loadOptions
public void loadOptions()
Loads all options' states from the backing settings instance.
-
saveOptions
public void saveOptions()
Saves all options' states to the backing settings instance.
-
-