Class OptionsHolder
java.lang.Object
|
+--OptionsHolder
- All Implemented Interfaces:
- java.io.Serializable
- public class OptionsHolder
- extends java.lang.Object
- implements java.io.Serializable
Class for storing Options.
This is a simple way of storing and extending choices with options,
such as color or representation.
This can then be used to create gui elements in the form of
drop down boxes, menus, etc.
- See Also:
Option
, Serialized Form
Constructor Summary |
OptionsHolder(java.lang.String title,
java.lang.String description)
Constructor |
Method Summary |
void |
addOption(Option option)
Adds a new option to the OptionsHolder |
java.awt.Choice |
createChoice()
Creates a Choice box that's a drop-down box of the
Options contained in this OptionsHolder |
Option |
getOption(int id)
Gets the Option based on its id |
Option |
getOption(java.lang.String name)
Gets the Option based on its name |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
m_strTitle
public java.lang.String m_strTitle
- title of the holder
m_strDescription
public java.lang.String m_strDescription
- description of the holder
OptionsHolder
public OptionsHolder(java.lang.String title,
java.lang.String description)
- Constructor
- Parameters:
title
- title of the OptionsHolderdescription
- desciption of the OptionsHolder
addOption
public void addOption(Option option)
- Adds a new option to the OptionsHolder
- Parameters:
option
- the Option to hold
getOption
public Option getOption(int id)
- Gets the Option based on its id
- Parameters:
id
- id of the Option- Returns:
- the Option in this OptionsHolder with the specified id
getOption
public Option getOption(java.lang.String name)
- Gets the Option based on its name
- Parameters:
name
- the name of the Option- Returns:
- the Option in this OptionsHolder with the specified name
createChoice
public java.awt.Choice createChoice()
- Creates a Choice box that's a drop-down box of the
Options contained in this OptionsHolder
- Returns:
- a Choice containing the list of Options