org.jscience.sociology.forms
Class ChoiceBox

java.lang.Object
  extended by org.jscience.sociology.forms.FormElement
      extended by org.jscience.sociology.forms.ChoiceBox
All Implemented Interfaces:
java.io.Serializable
Direct Known Subclasses:
MultipleChoiceBox, RadioButton

public abstract class ChoiceBox
extends FormElement

This abstract class is the superclass of classes representing Checkboxes, Combo Boxes, List Boxes and RadioButtons.

See Also:
MenuBox, CheckBox, RadioButton, Serialized Form

Constructor Summary
ChoiceBox()
           
 
Method Summary
 void addToValues(java.lang.String value)
          Adds a new value that can be checked or selected from this ChoiceBox.
abstract  java.lang.String chosen(java.lang.String value)
          This method finds out whether the given value has been checked/selected.
 
Methods inherited from class org.jscience.sociology.forms.FormElement
getErrorMessage, getName, getValue, setValue
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ChoiceBox

public ChoiceBox()
Method Detail

addToValues

public void addToValues(java.lang.String value)
Adds a new value that can be checked or selected from this ChoiceBox. This method is used by org.jscience.sociology.forms.FormParser class.

Parameters:
value - another value to this ChoiceBox.

chosen

public abstract java.lang.String chosen(java.lang.String value)
This method finds out whether the given value has been checked/selected. If the given value has been checked/selected respectively "checked" or "selected" is returned. Otherwise an empty string is returned. This method gets implemented by subclasses org.jscience.sociology.forms.MultipleChoiceBox and org.jscience.sociology.forms.RadioButton.

Parameters:
value - the value of the ChoiceBox item whose status is returned by this method.
Returns:
"selected", "checked" or "".