megamek.common.options
Class AbstractOptionsInfo

java.lang.Object
  extended by megamek.common.options.AbstractOptionsInfo
All Implemented Interfaces:
IOptionsInfo

public class AbstractOptionsInfo
extends java.lang.Object
implements IOptionsInfo

Abstract base class for Singletons representing Options' static information such as displayable name, description etc. The derived classes must implement the Singleton pattern


Field Summary
protected static java.lang.String DESCRIPTION_SUFFIX
           
protected static java.lang.String DISPLAYABLE_NAME_SUFFIX
           
protected static java.lang.String GROUP_SUFFIX
           
protected static java.lang.String OPTION_SUFFIX
           
 
Constructor Summary
protected AbstractOptionsInfo(java.lang.String name)
          Protected constructor.
 
Method Summary
(package private)  IBasicOptionGroup addGroup(java.lang.String name)
           
(package private)  IBasicOptionGroup addGroup(java.lang.String name, java.lang.String key)
           
(package private)  void addOptionInfo(IBasicOptionGroup group, java.lang.String name)
           
(package private)  void finish()
          Records that filling of this structure is finished.
protected  java.lang.String getGroupDisplayableName(java.lang.String groupName)
          Returns the user friendly NLS dependent name suitable for displaying in the options editor dialogs etc.
 java.util.Enumeration<IBasicOptionGroup> getGroups()
          Returns the Enumeration of the IBasicOptionGroup
 IOptionInfo getOptionInfo(java.lang.String name)
          Returns the IOptionInfo for the specified option
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

GROUP_SUFFIX

protected static final java.lang.String GROUP_SUFFIX
See Also:
Constant Field Values

OPTION_SUFFIX

protected static final java.lang.String OPTION_SUFFIX
See Also:
Constant Field Values

DISPLAYABLE_NAME_SUFFIX

protected static final java.lang.String DISPLAYABLE_NAME_SUFFIX
See Also:
Constant Field Values

DESCRIPTION_SUFFIX

protected static final java.lang.String DESCRIPTION_SUFFIX
See Also:
Constant Field Values
Constructor Detail

AbstractOptionsInfo

protected AbstractOptionsInfo(java.lang.String name)
Protected constructor. It is called only by descendants. The name must be unique because it's used to query the NLS dependent information from the resource bundle.

Parameters:
name - options info name
Method Detail

getOptionInfo

public IOptionInfo getOptionInfo(java.lang.String name)
Description copied from interface: IOptionsInfo
Returns the IOptionInfo for the specified option

Specified by:
getOptionInfo in interface IOptionsInfo
Parameters:
name - option name
Returns:
the IOptionInfo for the specified option
See Also:
IOptionInfo

getGroups

public java.util.Enumeration<IBasicOptionGroup> getGroups()
Description copied from interface: IOptionsInfo
Returns the Enumeration of the IBasicOptionGroup

Specified by:
getGroups in interface IOptionsInfo
Returns:
the Enumeration of the IBasicOptionGroup

addGroup

IBasicOptionGroup addGroup(java.lang.String name)

addGroup

IBasicOptionGroup addGroup(java.lang.String name,
                           java.lang.String key)

addOptionInfo

void addOptionInfo(IBasicOptionGroup group,
                   java.lang.String name)

getGroupDisplayableName

protected java.lang.String getGroupDisplayableName(java.lang.String groupName)
Returns the user friendly NLS dependent name suitable for displaying in the options editor dialogs etc.

Parameters:
groupName -
Returns:
group displayable name

finish

void finish()
Records that filling of this structure is finished. addGroup and addOptionInfo will have no effect after call of this function

See Also:
addGroup, addOptionInfo