net.sf.jolene.dom
Class Select

java.lang.Object
  extended by net.sf.jolene.dom.HTMLElement
      extended by net.sf.jolene.dom.Select
All Implemented Interfaces:
java.lang.Cloneable, IAttributes, ICollection, IStyles

public final class Select
extends HTMLElement

A Select in an html document.

Author:
Dan Howard

Constructor Summary
Select()
          Default constructor.
Select(java.lang.String name)
          Construct a select with the specified name.
 
Method Summary
 int addOption(Option option)
          This method adds a new option to the available options for the select object.
 void clearOptions()
          Clears the list of options on the select.
 Select clone()
          Returns a clone of the select object.
 java.lang.String getValue()
          Gets the value of the select object.
 boolean isMultiple()
          Indicates if the select is a multiple select.
 Option options(int index)
          Returns the specified option object by the numeric index.
 void setMultiple(boolean multiple)
          Sets if this select is a multiple select.
 void setName(java.lang.String name)
          Set the name of the select object.
 void setValue(java.lang.String value)
          Sets the value for the select object.
 void sortOptions()
          Sort the options on the select.
 java.lang.String toString()
          Renders the select.
 
Methods inherited from class net.sf.jolene.dom.HTMLElement
clear, getAfterText, getAttribute, getBeforeText, getContent, getName, getStyle, getTag, hasAttribute, hasStyle, isChecked, isDisabled, isReadonly, isRenderable, keySet, removeAttribute, removeStyle, resetStyles, resetStyles, setAfterText, setAttribute, setBeforeText, setChecked, setContent, setDisabled, setReadonly, setRenderable, setStyle, setStyles, setStyles, swapWith
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Select

public Select()
Default constructor.


Select

public Select(java.lang.String name)
Construct a select with the specified name.

Parameters:
name - name of the select.
Method Detail

addOption

public int addOption(Option option)
This method adds a new option to the available options for the select object.

Parameters:
option - An option object to add to the select list
Returns:
int - the new size of the option list.

clearOptions

public void clearOptions()
Clears the list of options on the select.


clone

public Select clone()
Returns a clone of the select object.

Overrides:
clone in class HTMLElement
Returns:
Select object.
See Also:
DocumentFactory

options

public Option options(int index)
Returns the specified option object by the numeric index.

Parameters:
index - the index of the option to retrive
Returns:
Option object.

getValue

public java.lang.String getValue()
Gets the value of the select object.

Overrides:
getValue in class HTMLElement
Returns:
value of the select object.

isMultiple

public boolean isMultiple()
Indicates if the select is a multiple select.

Returns:
mulitple

setName

public void setName(java.lang.String name)
Set the name of the select object.

Overrides:
setName in class HTMLElement
Parameters:
name - name of the select object.

setMultiple

public void setMultiple(boolean multiple)
Sets if this select is a multiple select.

Parameters:
multiple - boolean.

setValue

public void setValue(java.lang.String value)
Sets the value for the select object. The value to assign may be a single value or multiple values seperate by a comma.

Overrides:
setValue in class HTMLElement
Parameters:
value - String value to set.

sortOptions

public void sortOptions()
Sort the options on the select.


toString

public java.lang.String toString()
Renders the select.

Overrides:
toString in class HTMLElement
Returns:
The select as a html string.