Crossfire JXClient, Trunk
Classes | Public Member Functions | Private Attributes | List of all members
com.realtime.crossfire.jxclient.settings.options.OptionManager Class Reference
Collaboration diagram for com.realtime.crossfire.jxclient.settings.options.OptionManager:
Collaboration graph

Classes

class  Entry
 

Public Member Functions

void addOption (@NotNull final String optionName, @NotNull final String documentation, @NotNull final Option option) throws OptionException
 
CheckBoxOption getCheckBoxOption (@NotNull final String optionName) throws OptionException
 
Map< String, EntrygetOptions ()
 
void loadOptions ()
 
 OptionManager (@NotNull final Settings settings)
 
void removeOption (@NotNull final String optionName)
 
void saveOptions ()
 

Private Attributes

final Map< String, Entryoptions = new HashMap<>()
 
final Settings settings
 

Detailed Description

Maintains a set of named options.

Author
Andreas Kirschbaum

Definition at line 36 of file OptionManager.java.

Constructor & Destructor Documentation

◆ OptionManager()

com.realtime.crossfire.jxclient.settings.options.OptionManager.OptionManager ( @NotNull final Settings  settings)

Creates a new instance.

Parameters
settingsthe settings instance for loading/saving option values

Definition at line 54 of file OptionManager.java.

References com.realtime.crossfire.jxclient.settings.options.OptionManager.settings.

Member Function Documentation

◆ addOption()

void com.realtime.crossfire.jxclient.settings.options.OptionManager.addOption ( @NotNull final String  optionName,
@NotNull final String  documentation,
@NotNull final Option  option 
) throws OptionException

Adds a new option.

Parameters
optionNamethe option name to add
documentationthe documentation string for the settings
optionthe option to add
Exceptions
OptionExceptionif the option name is not unique

Definition at line 65 of file OptionManager.java.

References com.realtime.crossfire.jxclient.settings.options.OptionManager.options.

Referenced by com.realtime.crossfire.jxclient.skin.skin.DefaultJXCSkin.addOption(), and com.realtime.crossfire.jxclient.main.JXClient.JXClient().

Here is the caller graph for this function:

◆ getCheckBoxOption()

CheckBoxOption com.realtime.crossfire.jxclient.settings.options.OptionManager.getCheckBoxOption ( @NotNull final String  optionName) throws OptionException

Returns a checkbox option.

Parameters
optionNamethe option name to look up
Returns
the option
Exceptions
OptionExceptionif the option name does not exist

Definition at line 97 of file OptionManager.java.

References com.realtime.crossfire.jxclient.settings.options.OptionManager.Entry.getOption(), and com.realtime.crossfire.jxclient.settings.options.OptionManager.options.

Referenced by com.realtime.crossfire.jxclient.commands.SetCommand.execute().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ getOptions()

Map<String, Entry> com.realtime.crossfire.jxclient.settings.options.OptionManager.getOptions ( )

Returns all defined option names.

Returns
the option names

Definition at line 86 of file OptionManager.java.

References com.realtime.crossfire.jxclient.settings.options.OptionManager.options.

Referenced by com.realtime.crossfire.jxclient.commands.SetCommand.getHelp().

Here is the caller graph for this function:

◆ loadOptions()

void com.realtime.crossfire.jxclient.settings.options.OptionManager.loadOptions ( )

◆ removeOption()

void com.realtime.crossfire.jxclient.settings.options.OptionManager.removeOption ( @NotNull final String  optionName)

Removes an option by name. Does nothing if the option does not exist.

Parameters
optionNamethe option name to remove

Definition at line 77 of file OptionManager.java.

References com.realtime.crossfire.jxclient.settings.options.OptionManager.options.

◆ saveOptions()

void com.realtime.crossfire.jxclient.settings.options.OptionManager.saveOptions ( )

Member Data Documentation

◆ options

final Map<String, Entry> com.realtime.crossfire.jxclient.settings.options.OptionManager.options = new HashMap<>()
private

◆ settings

final Settings com.realtime.crossfire.jxclient.settings.options.OptionManager.settings
private

The documentation for this class was generated from the following file: