com.pushtotest.tool.parser.html
Class OptionElement

java.lang.Object
  extended by com.pushtotest.tool.parser.html.FormElementWrapper
      extended by com.pushtotest.tool.parser.html.OptionElement
All Implemented Interfaces:
FormElement, Selectable

public class OptionElement
extends FormElementWrapper
implements Selectable


Constructor Summary
OptionElement()
           
 
Method Summary
 java.lang.String getType()
          The type of this element.
 java.lang.String getValueAsString()
          The value parameter as a string.
 boolean isSelected()
          Is this element selected, checked, etc.
 void select(boolean select)
          Sets the selection value of this element.
 void setMultiple(boolean multiple)
          Sets the multiple value to a boolean.
 void setValueAsString(java.lang.String value)
          Sets the value of this element.
 boolean supportsMultiple()
          Does this form element support multiple selections.
 java.lang.String toString()
          A string representation of this option element.
 
Methods inherited from class com.pushtotest.tool.parser.html.FormElementWrapper
getId, getLabel, getName, getParentForm, isXhtml, setId, setLabel, setName, setParentForm
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

OptionElement

public OptionElement()
Method Detail

getType

public java.lang.String getType()
The type of this element.

Specified by:
getType in interface FormElement
Specified by:
getType in class FormElementWrapper
Returns:
The type of this element.

getValueAsString

public java.lang.String getValueAsString()
The value parameter as a string.

Specified by:
getValueAsString in interface FormElement
Specified by:
getValueAsString in class FormElementWrapper
Returns:
The value of this element as a string.

setValueAsString

public void setValueAsString(java.lang.String value)
Sets the value of this element.

Specified by:
setValueAsString in interface FormElement
Specified by:
setValueAsString in class FormElementWrapper
Parameters:
value - The value of the form element as a string.

toString

public java.lang.String toString()
A string representation of this option element.

Overrides:
toString in class java.lang.Object
Returns:
The string that is like this element.

isSelected

public boolean isSelected()
Is this element selected, checked, etc.

Specified by:
isSelected in interface Selectable
Returns:
Whether or not this element is selected.

select

public void select(boolean select)
Sets the selection value of this element. Some elements might not support multiple selects (e.g. radio), so calling this with true will cause them to possibly unselect other values.

Specified by:
select in interface Selectable
Parameters:
select - Whether or not this element should be selected.

supportsMultiple

public boolean supportsMultiple()
Does this form element support multiple selections. Could be constant (e.g. checkbox would be true and radio would be false) or (like selects) could depend on parameters in the form element.

Specified by:
supportsMultiple in interface Selectable
Returns:
Whether this Selectable item supports multiple selections.

setMultiple

public void setMultiple(boolean multiple)
Sets the multiple value to a boolean. Some implementations should ignore this setting because they will always or never support multiples.

Specified by:
setMultiple in interface Selectable
Parameters:
multiple - Sets the multiple value.