com.meterware.httpunit
Class SubmitButton

java.lang.Object
  extended by com.meterware.httpunit.Button
      extended by com.meterware.httpunit.SubmitButton
All Implemented Interfaces:
HTMLElement

public class SubmitButton
extends Button

This class represents a submit button in an HTML form.


Field Summary
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
           
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
           
 
Fields inherited from class com.meterware.httpunit.Button
WITH_ID, WITH_LABEL
 
Method Summary
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.
 void click(int x, int y)
          Performs the action associated with clicking this button after running any 'onClick' script.
protected  void doButtonAction()
          Perform the normal action of this button.
 boolean equals(java.lang.Object o)
           
 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)
           
 java.lang.String getClassName()
          Returns the class associated with this element.
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 values permitted in this control.
 ScriptableDelegate getScriptableDelegate()
          Returns a scriptable object which can act as a proxy for this control.
 java.lang.String getTagName()
          Returns the tag name of this node.
 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.
 int hashCode()
           
 boolean isImageButton()
          Returns true if this submit button is an image map.
 boolean isSupportedAttribute(java.lang.String name)
          Returns true if this element may have an attribute with the specified name.
protected  void sendOnChangeEvent()
          Performs the 'onChange' event defined for this control.
protected  void sendOnClickEvent()
          Performs the 'onClick' event defined for this control.
 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.
 java.lang.String toString()
           
 
Methods inherited from class com.meterware.httpunit.Button
click, doOnClickEvent, getParentDelegate, getValue, isDisabled, newScriptable, verifyButtonEnabled
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

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
Method Detail

getType

public java.lang.String getType()
Return the type of the control, as seen from JavaScript.

Overrides:
getType in class Button

isImageButton

public boolean isImageButton()
Returns true if this submit button is an image map.


click

public void click(int x,
                  int y)
           throws java.io.IOException,
                  org.xml.sax.SAXException
Performs the action associated with clicking this button after running any 'onClick' script. For a submit button this typically submits the form.

Throws:
java.io.IOException
org.xml.sax.SAXException
Since:
1.6

doButtonAction

protected void doButtonAction()
                       throws java.io.IOException,
                              org.xml.sax.SAXException
Perform the normal action of this button.

Overrides:
doButtonAction in class Button
Throws:
java.io.IOException
org.xml.sax.SAXException

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

hashCode

public int hashCode()
Overrides:
hashCode in class java.lang.Object

equals

public boolean equals(java.lang.Object o)
Overrides:
equals in class java.lang.Object

getForm

protected final WebForm getForm()

getOptionValues

public java.lang.String[] getOptionValues()
Returns the values permitted in this control. Does not apply to text or file controls.


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.


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.


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 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

getTagName

public java.lang.String getTagName()
Description copied from interface: HTMLElement
Returns the tag name of this node.

Specified by:
getTagName 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)

Copyright © 2000-2006 Russell Gold. See license agreement for rights granted.