|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.meterware.httpunit.HTMLElementBase com.meterware.httpunit.FormControl
Represents a control in an HTML form.
Nested Class Summary | |
class |
FormControl.Scriptable
implementation of Scriptable input elements |
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
|
Constructor Summary | |
protected |
FormControl(WebForm form,
com.meterware.httpunit.dom.HTMLControl control)
initialize the given form control from a Webform and a HTMLControl |
Method Summary | |
protected abstract void |
addValues(com.meterware.httpunit.protocol.ParameterProcessor processor,
java.lang.String characterSet)
|
protected void |
claimUniqueValue(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. |
boolean |
doEvent(java.lang.String eventScript)
Deprecated. since 1.7 - use doEventScript instead |
boolean |
doEventScript(java.lang.String eventScript)
optional do the event if it's defined |
protected boolean |
doOnChangeEvent()
Performs the 'onchange' event defined for this control. |
protected boolean |
doOnClickEvent()
Performs the 'onClick' event defined for this control. |
protected boolean |
doOnMouseDownEvent()
Performs the 'onMouseDown' event defined for this control. |
protected boolean |
doOnMouseUpEvent()
Performs the 'onMouseUp' event defined for this control. |
protected java.lang.String |
emptyIfNull(java.lang.String value)
|
java.lang.String |
getAttribute(java.lang.String name)
get the Attribute with the given name - by delegating to NodeUtils |
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 java.lang.String[] |
getDisplayedOptions()
Returns the list of values displayed by this control, if any. |
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. |
org.w3c.dom.Node |
getNode()
Returns the DOM node underlying this element. |
java.lang.String[] |
getOptionValues()
Returns the values permitted in this control. |
ScriptableDelegate |
getParentDelegate()
Returns the scriptable delegate which can provide the scriptable delegate for this element. |
ScriptingHandler |
getScriptingHandler()
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. |
abstract java.lang.String |
getType()
Return the type of the control, as seen from JavaScript. |
protected java.lang.String |
getValueAttribute()
Returns the value of this control in the form. |
protected abstract java.lang.String[] |
getValues()
Returns the current value(s) associated with this control. |
boolean |
handleEvent(java.lang.String eventName)
handle the event with the given name by getting the attribute and then executing the eventScript for it |
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 |
isHidden()
Returns true if this control is hidden. |
protected boolean |
isMultiValued()
Returns true if a single control can have multiple values. |
protected 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. |
ScriptableDelegate |
newScriptable()
Creates and returns a scriptable object for this control. |
void |
removeAttribute(java.lang.String name)
remove the Attribute with the given name - by delegating to NodeUtils |
protected void |
reset()
Resets this control to its initial value. |
protected void |
sendOnChangeEvent()
Deprecated. since 1.7 use doOnChangeEvent instead |
protected void |
sendOnClickEvent()
Deprecated. since 1.7 use doOnClickEvent instead |
protected void |
sendOnMouseDownEvent()
Deprecated. since 1.7 use doOnMouseDownEvent instead |
protected void |
sendOnMouseUpEvent()
Deprecated. since 1.7 use doOnMouseUpEvent instead |
void |
setAttribute(java.lang.String name,
java.lang.Object value)
set the Attribute with the given name - by delegating to NodeUtils |
void |
setState(boolean state)
Sets the state of this boolean control. |
protected void |
setValueAttribute(java.lang.String value)
Sets the value of this control in the form. |
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 |
public static final java.lang.String UNDEFINED_TYPE
public static final java.lang.String BUTTON_TYPE
public static final java.lang.String RESET_BUTTON_TYPE
public static final java.lang.String SUBMIT_BUTTON_TYPE
public static final java.lang.String IMAGE_BUTTON_TYPE
public static final java.lang.String RADIO_BUTTON_TYPE
public static final java.lang.String CHECKBOX_TYPE
public static final java.lang.String TEXT_TYPE
public static final java.lang.String PASSWORD_TYPE
public static final java.lang.String HIDDEN_TYPE
public static final java.lang.String TEXTAREA_TYPE
public static final java.lang.String FILE_TYPE
public static final java.lang.String SINGLE_TYPE
public static final java.lang.String MULTIPLE_TYPE
Constructor Detail |
protected FormControl(WebForm form, com.meterware.httpunit.dom.HTMLControl control)
form
- control
- Method Detail |
public abstract java.lang.String getType()
protected abstract java.lang.String[] getValues()
protected final WebForm getForm()
public ScriptableDelegate getParentDelegate()
HTMLElement
public java.lang.String[] getOptionValues()
protected java.lang.String[] getDisplayedOptions()
protected boolean isReadOnly()
public boolean isHidden()
public boolean isDisabled()
protected boolean isMultiValued()
protected abstract void addValues(com.meterware.httpunit.protocol.ParameterProcessor processor, java.lang.String characterSet) throws java.io.IOException
java.io.IOException
protected void claimUniqueValue(java.util.List values)
protected void reset()
public void toggle()
public void setState(boolean state)
protected void sendOnChangeEvent()
protected boolean doOnChangeEvent()
protected void sendOnClickEvent()
protected boolean doOnClickEvent()
protected void sendOnMouseUpEvent()
protected boolean doOnMouseUpEvent()
protected void sendOnMouseDownEvent()
protected boolean doOnMouseDownEvent()
public ScriptableDelegate newScriptable()
protected java.lang.String getValueAttribute()
protected void setValueAttribute(java.lang.String value)
protected final void claimValueIsRequired(java.util.List values, java.lang.String value)
protected java.lang.String emptyIfNull(java.lang.String value)
public java.lang.String getID()
HTMLElement
getID
in interface HTMLElement
public java.lang.String getClassName()
HTMLElement
getClassName
in interface HTMLElement
public java.lang.String getTitle()
HTMLElement
getTitle
in interface HTMLElement
public java.lang.String getName()
HTMLElement
getName
in interface HTMLElement
public ScriptingHandler getScriptingHandler()
getScriptingHandler
in interface HTMLElement
public boolean doEvent(java.lang.String eventScript)
doEvent
in interface ScriptingEventHandler
eventScript
- - the script to use
public boolean doEventScript(java.lang.String eventScript)
doEventScript
in interface ScriptingEventHandler
eventScript
-
public boolean handleEvent(java.lang.String eventName)
ScriptingEventHandler
handleEvent
in interface ScriptingEventHandler
eventName
-
public java.lang.String getText()
getText
in interface HTMLElement
public java.lang.String getTagName()
HTMLElement
getTagName
in interface HTMLElement
public java.lang.String getAttribute(java.lang.String name)
getAttribute
in interface HTMLElement
name
- - the name of the attribute to get
public void setAttribute(java.lang.String name, java.lang.Object value)
setAttribute
in interface HTMLElement
name
- - the name of the attribute to setvalue
- - the value to setpublic void removeAttribute(java.lang.String name)
removeAttribute
in interface HTMLElement
name
- - the name of the attribute to removepublic boolean isSupportedAttribute(java.lang.String name)
HTMLElement
isSupportedAttribute
in interface HTMLElement
protected java.lang.String getAttribute(java.lang.String name, java.lang.String defaultValue)
public org.w3c.dom.Node getNode()
HTMLElement
getNode
in interface HTMLElement
protected void supportAttribute(java.lang.String name)
|
Copyright © 2000-2008 Russell Gold. See license agreement for rights granted. | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |