OME
Class Choice

java.lang.Object
  |
  +--OME.Choice

public class Choice
extends java.lang.Object

This class contains the information necessary to present a particular option to a user and to record thier response to that option (ie whether the option should be selected or not). This class is used by CheckboxChooser and could be used by other classes in the future (maybe a RadiobuttonChooser etc).


Constructor Summary
Choice()
          Creates a Choice.
Choice(java.lang.String name)
          Creates a Choice with the specified name.
 
Method Summary
 java.lang.Object choiceObject()
          This method returns the object associated with this Choice.
 boolean chosen()
          Returns whether this Choice has been chosen.
 java.lang.String description()
          Returns the (user-friendly) description for this Choice.
 java.lang.String getName()
          Returns the name of this Choice.
 boolean isEnabled()
          returns whether this Choice is enabled.
 boolean mandatory()
          Returns whether this Choice is mandatory or not.
 java.lang.String name()
          Returns the (user-friendly) name of this Choice.
 void setChoiceObject(java.lang.Object o)
          Sets the Object associated with this Choice.
 void setChosen(boolean b)
          Sets whether this Choice is chosen.
 void setDescription(java.lang.String s)
          Sets the description of this Choice.
 void setEnabled(boolean b)
          sets whether the Choice should be enabled.
 void setMandatory(boolean m)
          Sets whether this choice is mandatory or not.
 void setName(java.lang.String s)
          Sets the name of this Choice.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Choice

public Choice()
Creates a Choice.

Choice

public Choice(java.lang.String name)
Creates a Choice with the specified name.
Parameters:
name - the name of this Choice.
Method Detail

mandatory

public boolean mandatory()
Returns whether this Choice is mandatory or not. Mandatory choices are shown but are not modifiable.

name

public java.lang.String name()
Returns the (user-friendly) name of this Choice.

description

public java.lang.String description()
Returns the (user-friendly) description for this Choice. (CheckboxChooser does not currently use this).
Returns:
the desciption of the Choice.

chosen

public boolean chosen()
Returns whether this Choice has been chosen.

choiceObject

public java.lang.Object choiceObject()
This method returns the object associated with this Choice. This allows us to associate things we might actually use with this choice (instead of having to deal with user-friendly strings all the time).

setMandatory

public void setMandatory(boolean m)
Sets whether this choice is mandatory or not. Mandatory choices are shown but are not modifiable.
Parameters:
m - the boolean value indicating whether this Choice is mandatory or not.

setName

public void setName(java.lang.String s)
Sets the name of this Choice.
Parameters:
s - the name of the Choice.

getName

public java.lang.String getName()
Returns the name of this Choice.
Returns:
the name of the Choice.

setDescription

public void setDescription(java.lang.String s)
Sets the description of this Choice. (checkboxChooser does not currently use this).
Parameters:
s - the description of this Choice.

setChosen

public void setChosen(boolean b)
Sets whether this Choice is chosen.
Parameters:
b - a boolean value indicating whether this Choice is chosen or not.

setChoiceObject

public void setChoiceObject(java.lang.Object o)
Sets the Object associated with this Choice.
Parameters:
o - the object associated with this Choice.

setEnabled

public void setEnabled(boolean b)
sets whether the Choice should be enabled.
Parameters:
b - a boolean value indicating whether this Choice is enabled or not.

isEnabled

public boolean isEnabled()
returns whether this Choice is enabled.
Returns:
whether this Choice is enabled or not.