Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

com.meterware.httpunit
Class RadioGroupFormControl  view RadioGroupFormControl download RadioGroupFormControl.java

java.lang.Object
  extended bycom.meterware.httpunit.HTMLElementBase
      extended bycom.meterware.httpunit.FormControl
          extended bycom.meterware.httpunit.RadioGroupFormControl
All Implemented Interfaces:
HTMLElement

class RadioGroupFormControl
extends FormControl


Nested Class Summary
(package private)  class FormControl.Scriptable
           
 
Field Summary
private  java.lang.String[] _allowedValues
           
private  java.util.List _buttonList
           
private  RadioButtonFormControl[] _buttons
           
static java.lang.String BUTTON_TYPE
           
static java.lang.String CHECKBOX_TYPE
           
static java.lang.String FILE_TYPE
           
static java.lang.String HIDDEN_TYPE
           
static java.lang.String IMAGE_BUTTON_TYPE
           
static java.lang.String MULTIPLE_TYPE
           
(package private) static java.lang.String[] NO_VALUE
           
static java.lang.String PASSWORD_TYPE
           
static java.lang.String RADIO_BUTTON_TYPE
           
static java.lang.String RESET_BUTTON_TYPE
           
static java.lang.String SINGLE_TYPE
           
static java.lang.String SUBMIT_BUTTON_TYPE
           
static java.lang.String TEXT_TYPE
           
static java.lang.String TEXTAREA_TYPE
           
static java.lang.String UNDEFINED_TYPE
           
 
Constructor Summary
RadioGroupFormControl(WebForm form)
           
 
Method Summary
(package private)  void addRadioButton(RadioButtonFormControl control)
           
(package private)  void addValues(ParameterProcessor processor, java.lang.String characterSet)
           
(package private)  void claimRequiredValues(java.util.List values)
          Remove any required values for this control from the list, throwing an exception if they are missing.
(package private)  void claimUniqueValue(java.util.List values)
          Sets this control to the next compatible value from the list, removing it from the list.
(package private)  void claimUploadSpecification(java.util.List files)
          Specifies a file to be uploaded via this control.
(package private)  void claimValue(java.util.List values)
          Sets this control to the next compatible value from the list, removing it from the list.
protected  void claimValueIsRequired(java.util.List values, java.lang.String value)
          Removes the specified required value from the list of values, throwing an exception if it is missing.
private  java.lang.String[] getAllowedValues()
           
 java.lang.String getAttribute(java.lang.String name)
          Returns the value of the attribute of this element with the specified name.
protected  java.lang.String getAttribute(java.lang.String name, java.lang.String defaultValue)
           
private  RadioButtonFormControl[] getButtons()
           
 java.lang.String getClassName()
          Returns the class associated with this element.
(package private) static java.lang.String[] getControlElementTags()
           
(package private)  java.lang.Object getDelegate()
          Returns either a single delegate object or potentially an array of delegates as needed, given the form control.
(package private)  java.lang.String[] getDisplayedOptions()
          Returns the options displayed for this radio button group.
protected  WebForm getForm()
           
 java.lang.String getID()
          Returns the ID associated with this element.
 java.lang.String getName()
          Returns the name associated with this element.
protected  org.w3c.dom.Node getNode()
           
 java.lang.String[] getOptionValues()
          Returns the option values defined for this radio button group.
protected  com.meterware.httpunit.scripting.ScriptableDelegate getParentDelegate()
          Returns the scriptable delegate which can provide the scriptable delegate for this element.
 com.meterware.httpunit.scripting.ScriptableDelegate getScriptableDelegate()
          Returns a scriptable object which can act as a proxy for this control.
 java.lang.String getText()
          Returns the text value of this block.
 java.lang.String getTitle()
          Returns the title associated with this element.
 java.lang.String getType()
          Return the type of the control, as seen from JavaScript.
protected  java.lang.String getValueAttribute()
          Returns the default value of this control in the form.
 java.lang.String[] getValues()
          Returns the current value(s) associated with this control.
(package private)  boolean isDisabled()
          Returns true if this control is disabled, meaning that it will not send a value to the server as part of a request.
(package private)  boolean isExclusive()
          Returns true if only one control of this kind with this name can have a value.
(package private)  boolean isFileParameter()
          Returns true if this control accepts a file for upload.
(package private)  boolean isHidden()
          Returns true if this control is hidden.
(package private)  boolean isMultiValued()
          Returns true if a single control can have multiple values.
(package private)  boolean isReadOnly()
          Returns true if this control is read-only.
 boolean isSupportedAttribute(java.lang.String name)
          Returns true if this element may have an attribute with the specified name.
(package private)  boolean isTextControl()
          Returns true if this control accepts free-form text.
(package private) static FormControl newFormParameter(WebForm form, org.w3c.dom.Node node)
           
protected  com.meterware.httpunit.scripting.ScriptableDelegate newScriptable()
          Creates and returns a scriptable object for this control.
(package private) static com.meterware.httpunit.scripting.ScriptableDelegate newSelectionOption()
           
(package private)  void reset()
          Resets this control to its initial value.
protected  void sendOnChangeEvent()
          Performs the 'onChange' event defined for this control.
protected  void sendOnClickEvent()
          Performs the 'onClick' event defined for this control.
(package private)  void setDisabled(boolean disabled)
           
 void setState(boolean state)
          Sets the state of this boolean control.
protected  void supportAttribute(java.lang.String name)
           
 void toggle()
          Toggles the value of this control.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

_buttonList

private java.util.List _buttonList

_buttons

private RadioButtonFormControl[] _buttons

_allowedValues

private java.lang.String[] _allowedValues

NO_VALUE

static final java.lang.String[] NO_VALUE

UNDEFINED_TYPE

public static final java.lang.String UNDEFINED_TYPE
See Also:
Constant Field Values

BUTTON_TYPE

public static final java.lang.String BUTTON_TYPE
See Also:
Constant Field Values

RESET_BUTTON_TYPE

public static final java.lang.String RESET_BUTTON_TYPE
See Also:
Constant Field Values

SUBMIT_BUTTON_TYPE

public static final java.lang.String SUBMIT_BUTTON_TYPE
See Also:
Constant Field Values

IMAGE_BUTTON_TYPE

public static final java.lang.String IMAGE_BUTTON_TYPE
See Also:
Constant Field Values

RADIO_BUTTON_TYPE

public static final java.lang.String RADIO_BUTTON_TYPE
See Also:
Constant Field Values

CHECKBOX_TYPE

public static final java.lang.String CHECKBOX_TYPE
See Also:
Constant Field Values

TEXT_TYPE

public static final java.lang.String TEXT_TYPE
See Also:
Constant Field Values

PASSWORD_TYPE

public static final java.lang.String PASSWORD_TYPE
See Also:
Constant Field Values

HIDDEN_TYPE

public static final java.lang.String HIDDEN_TYPE
See Also:
Constant Field Values

TEXTAREA_TYPE

public static final java.lang.String TEXTAREA_TYPE
See Also:
Constant Field Values

FILE_TYPE

public static final java.lang.String FILE_TYPE
See Also:
Constant Field Values

SINGLE_TYPE

public static final java.lang.String SINGLE_TYPE
See Also:
Constant Field Values

MULTIPLE_TYPE

public static final java.lang.String MULTIPLE_TYPE
See Also:
Constant Field Values
Constructor Detail

RadioGroupFormControl

public RadioGroupFormControl(WebForm form)
Method Detail

getType

public java.lang.String getType()
Description copied from class: FormControl
Return the type of the control, as seen from JavaScript.

Specified by:
getType in class FormControl

addRadioButton

void addRadioButton(RadioButtonFormControl control)

getValues

public java.lang.String[] getValues()
Description copied from class: FormControl
Returns the current value(s) associated with this control. These values will be transmitted to the server if the control is 'successful'.

Specified by:
getValues in class FormControl

getOptionValues

public java.lang.String[] getOptionValues()
Returns the option values defined for this radio button group.

Overrides:
getOptionValues in class FormControl

getDisplayedOptions

java.lang.String[] getDisplayedOptions()
Returns the options displayed for this radio button group.

Overrides:
getDisplayedOptions in class FormControl

getDelegate

java.lang.Object getDelegate()
Description copied from class: FormControl
Returns either a single delegate object or potentially an array of delegates as needed, given the form control. This default implementation returns the scriptable delegate for the control.

Overrides:
getDelegate in class FormControl

addValues

void addValues(ParameterProcessor processor,
               java.lang.String characterSet)
         throws java.io.IOException
Specified by:
addValues in class FormControl

claimRequiredValues

void claimRequiredValues(java.util.List values)
Remove any required values for this control from the list, throwing an exception if they are missing.

Overrides:
claimRequiredValues in class FormControl

claimUniqueValue

void claimUniqueValue(java.util.List values)
Description copied from class: FormControl
Sets this control to the next compatible value from the list, removing it from the list.

Overrides:
claimUniqueValue in class FormControl

reset

void reset()
Description copied from class: FormControl
Resets this control to its initial value.

Overrides:
reset in class FormControl

getAllowedValues

private java.lang.String[] getAllowedValues()

getButtons

private RadioButtonFormControl[] getButtons()

newSelectionOption

static com.meterware.httpunit.scripting.ScriptableDelegate newSelectionOption()

getForm

protected final WebForm getForm()

getParentDelegate

protected com.meterware.httpunit.scripting.ScriptableDelegate getParentDelegate()
Description copied from class: HTMLElementBase
Returns the scriptable delegate which can provide the scriptable delegate for this element.

Specified by:
getParentDelegate in class HTMLElementBase

isReadOnly

boolean isReadOnly()
Returns true if this control is read-only.


isHidden

boolean isHidden()
Returns true if this control is hidden.


setDisabled

void setDisabled(boolean disabled)

isDisabled

boolean isDisabled()
Returns true if this control is disabled, meaning that it will not send a value to the server as part of a request.


isTextControl

boolean isTextControl()
Returns true if this control accepts free-form text.


isExclusive

boolean isExclusive()
Returns true if only one control of this kind with this name can have a value. This is true for radio buttons.


isMultiValued

boolean isMultiValued()
Returns true if a single control can have multiple values.


isFileParameter

boolean isFileParameter()
Returns true if this control accepts a file for upload.


claimValue

void claimValue(java.util.List values)
Sets this control to the next compatible value from the list, removing it from the list.


claimUploadSpecification

void claimUploadSpecification(java.util.List files)
Specifies a file to be uploaded via this control.


toggle

public void toggle()
Toggles the value of this control.


setState

public void setState(boolean state)
Sets the state of this boolean control.


sendOnChangeEvent

protected void sendOnChangeEvent()
Performs the 'onChange' event defined for this control.


sendOnClickEvent

protected void sendOnClickEvent()
Performs the 'onClick' event defined for this control.


newScriptable

protected com.meterware.httpunit.scripting.ScriptableDelegate newScriptable()
Creates and returns a scriptable object for this control. Subclasses should override this if they use a different implementation of Scriptable.

Overrides:
newScriptable in class HTMLElementBase

getValueAttribute

protected java.lang.String getValueAttribute()
Returns the default value of this control in the form. If no value is specified, defaults to the empty string.


claimValueIsRequired

protected final void claimValueIsRequired(java.util.List values,
                                          java.lang.String value)
Removes the specified required value from the list of values, throwing an exception if it is missing.


getControlElementTags

static java.lang.String[] getControlElementTags()

newFormParameter

static FormControl newFormParameter(WebForm form,
                                    org.w3c.dom.Node node)

getID

public java.lang.String getID()
Description copied from interface: HTMLElement
Returns the ID associated with this element. IDs are unique throughout the HTML document.

Specified by:
getID in interface HTMLElement

getClassName

public java.lang.String getClassName()
Description copied from interface: HTMLElement
Returns the class associated with this element.

Specified by:
getClassName in interface HTMLElement

getTitle

public java.lang.String getTitle()
Description copied from interface: HTMLElement
Returns the title associated with this element.

Specified by:
getTitle in interface HTMLElement

getName

public java.lang.String getName()
Description copied from interface: HTMLElement
Returns the name associated with this element.

Specified by:
getName in interface HTMLElement

getScriptableDelegate

public com.meterware.httpunit.scripting.ScriptableDelegate getScriptableDelegate()
Returns a scriptable object which can act as a proxy for this control.

Specified by:
getScriptableDelegate in interface HTMLElement

getText

public java.lang.String getText()
Returns the text value of this block.

Specified by:
getText in interface HTMLElement

getAttribute

public java.lang.String getAttribute(java.lang.String name)
Description copied from interface: HTMLElement
Returns the value of the attribute of this element with the specified name. Returns the empty string if no such attribute exists.

Specified by:
getAttribute in interface HTMLElement

isSupportedAttribute

public boolean isSupportedAttribute(java.lang.String name)
Description copied from interface: HTMLElement
Returns true if this element may have an attribute with the specified name.

Specified by:
isSupportedAttribute in interface HTMLElement

getAttribute

protected java.lang.String getAttribute(java.lang.String name,
                                        java.lang.String defaultValue)

getNode

protected org.w3c.dom.Node getNode()

supportAttribute

protected void supportAttribute(java.lang.String name)