 |
Crossfire JXClient, Trunk
|
Go to the documentation of this file.
23 package com.realtime.crossfire.jxclient.settings.options;
27 import java.util.Collections;
28 import java.util.HashMap;
30 import org.jetbrains.annotations.NotNull;
42 private final Map<String, Entry>
options =
new HashMap<>();
66 if (
options.containsKey(optionName)) {
70 options.put(optionName,
new Entry(option, documentation));
87 return Collections.unmodifiableMap(
options);
111 final String optionName = e.getKey();
112 final Object option = e.getValue().getOption();
115 if (checkBoxOption.isChecked() == checked) {
117 checkBoxOption.fireStateChangedEvent();
119 checkBoxOption.setChecked(checked);
122 throw new AssertionError();
132 final String optionName = e.getKey();
133 final Entry entry = e.getValue();
139 throw new AssertionError();
void saveOptions()
Saves all options' states to the backing settings instance.
boolean inhibitSave()
Returns whether the option should not be saved.
void removeOption(@NotNull final String optionName)
Removes an option by name.
final Map< String, Entry > options
Maps option name to option instance.
boolean getBoolean(@NotNull final SettingsEntry< Boolean > key)
Returns the boolean associated with the specified key at a node or.
void addOption(@NotNull final String optionName, @NotNull final String documentation, @NotNull final Option option)
Adds a new option.
void loadOptions()
Loads all options' states from the backing settings instance.
final Settings settings
The settings instance for loading/saving option values.
final String documentation
The corresponding documentation string.
void putBoolean(@NotNull final SettingsEntry< Boolean > key, final boolean value)
Stores a key/value pair.
CheckBoxOption getCheckBoxOption(@NotNull final String optionName)
Returns a checkbox option.
OptionManager(@NotNull final Settings settings)
Creates a new instance.
An entry in the settings file.
final Option option
The Option instance.
Maintains a set of named options.
Maintains a set of key/value pairs.
Pair of Option and corresponding documentation string.
The base class for all options.
Entry(@NotNull final Option option, @NotNull final String documentation)
Creates a new instance.
Map< String, Entry > getOptions()
Returns all defined option names.
String getDocumentation()
Returns the corresponding documentation string.
The base class for all check box options.
Option getOption()
Returns the Option instance.
Indicates about an incorrect option.