com.meterware.httpunit
Class SubmitButton

java.lang.Object
  |
  +--com.meterware.httpunit.FormControl
        |
        +--com.meterware.httpunit.SubmitButton

public class SubmitButton
extends com.meterware.httpunit.FormControl

This class represents a submit button in an HTML form.


Field Summary
static SubmitButton UNNAMED_BUTTON
           
 
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.
 boolean equals(java.lang.Object o)
           
 java.lang.String[] getDisplayedOptions()
          Returns the list of values displayed by this control, if any.
 java.lang.String getID()
          Returns the ID associated with the button, if any.
 java.lang.String getName()
          Returns the name of this control.
 java.lang.String[] getOptionValues()
          Returns the values permitted in this control.
 ScriptableObject getScriptableObject()
          Returns a scriptable object which can act as a proxy for this control.
 java.lang.String getValue()
          Returns the value associated with this submit button.
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.
 int hashCode()
           
 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.
 boolean isExclusive()
          Returns true if only one control of this kind can have a value.
 boolean isFileParameter()
          Returns true if this control accepts a file for upload.
 boolean isImageButton()
          Returns true if this submit button is an image map.
 boolean isMultiValued()
          Returns true if a single control can have multiple values.
 boolean isReadOnly()
          Returns true if this control is read-only.
 boolean isTextControl()
          Returns true if this control accepts free-form text.
 void setLocation(int x, int y)
           
 void setPressed(boolean pressed)
           
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

UNNAMED_BUTTON

public static SubmitButton UNNAMED_BUTTON
Method Detail

getValue

public java.lang.String getValue()
Returns the value associated with this submit button.


getID

public java.lang.String getID()
Returns the ID associated with the button, if any.

Returns:
the button ID, or an empty string if no ID is defined.

isImageButton

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


getValues

public java.lang.String[] getValues()
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 com.meterware.httpunit.FormControl

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

setPressed

public void setPressed(boolean pressed)

setLocation

public void setLocation(int x,
                        int y)

getName

public java.lang.String getName()
Returns the name of this control. If no name is specified, defaults to the empty string.


getScriptableObject

public ScriptableObject getScriptableObject()
Returns a scriptable object which can act as a proxy for this control.


getOptionValues

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


getDisplayedOptions

public java.lang.String[] getDisplayedOptions()
Returns the list of values displayed by this control, if any.


isReadOnly

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


isDisabled

public 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

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


isExclusive

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


isMultiValued

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


isFileParameter

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


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.


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