Package com.meterware.httpunit
Class FormControl.Scriptable
- java.lang.Object
-
- com.meterware.httpunit.scripting.ScriptableDelegate
-
- com.meterware.httpunit.FormControl.Scriptable
-
- All Implemented Interfaces:
DocumentElement,IdentifiedDelegate,Input,NamedDelegate,ScriptingEventHandler,ScriptingHandler
- Enclosing class:
- FormControl
public class FormControl.Scriptable extends ScriptableDelegate implements Input
implementation of Scriptable input elements
-
-
Field Summary
-
Fields inherited from class com.meterware.httpunit.scripting.ScriptableDelegate
NULL_SCRIPT_ENGINE
-
-
Constructor Summary
Constructors Constructor Description Scriptable()construct a Scriptable
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidblur()simulate blurvoidclick()allow calling click for this controlvoidfocus()simulate focus;java.lang.Objectget(java.lang.String propertyName)get the given propertyprotected HTMLElementget_element()java.lang.StringgetAttribute(java.lang.String attributeName)get the content of the given attributejava.lang.StringgetID()get my IDjava.lang.StringgetName()get my NamebooleanhandleEvent(java.lang.String eventName)Executes the event Handler script for the specified event (such as onchange, onmousedown, onclick, onmouseup) if it is defined.voidremoveAttribute(java.lang.String attributeName)remove the given attributevoidsendOnChangeEvent()allow firing a sendOnChangeEventvoidset(java.lang.String propertyName, java.lang.Object value)set the given property to the given valuevoidsetAttribute(java.lang.String attributeName, java.lang.Object value)set the given attribute to the given value-
Methods inherited from class com.meterware.httpunit.scripting.ScriptableDelegate
clearCaches, doEvent, doEventScript, evaluateExpression, get, getDelegates, getScriptEngine, getScriptEngine, runScript, setScriptEngine, supportsScriptLanguage
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface com.meterware.httpunit.scripting.Input
removeAttribute
-
-
-
-
Method Detail
-
getName
public java.lang.String getName()
get my Name- Specified by:
getNamein interfaceNamedDelegate- Returns:
- the name of this scriptable
-
getID
public java.lang.String getID()
get my ID- Specified by:
getIDin interfaceIdentifiedDelegate- Returns:
- the id of this scriptable
-
get
public java.lang.Object get(java.lang.String propertyName)
get the given property
-
set
public void set(java.lang.String propertyName, java.lang.Object value)set the given property to the given value- Specified by:
setin interfaceInput- Overrides:
setin classScriptableDelegate- Parameters:
propertyName- - the property to setvalue- - the value to use
-
setAttribute
public void setAttribute(java.lang.String attributeName, java.lang.Object value)set the given attribute to the given value- Specified by:
setAttributein interfaceInput- Parameters:
attributeName- - the name of the attribute to setvalue- - the value to use
-
click
public void click() throws java.io.IOException, org.xml.sax.SAXExceptionallow calling click for this control
-
blur
public void blur()
simulate blur
-
focus
public void focus()
simulate focus;
-
sendOnChangeEvent
public void sendOnChangeEvent()
allow firing a sendOnChangeEvent- Specified by:
sendOnChangeEventin interfaceInput
-
get_element
protected HTMLElement get_element()
- Returns:
- the _element
-
getAttribute
public java.lang.String getAttribute(java.lang.String attributeName)
get the content of the given attribute- Parameters:
attributeName-- Returns:
- the attribute as a string
-
removeAttribute
public void removeAttribute(java.lang.String attributeName)
remove the given attribute- Parameters:
attributeName-
-
handleEvent
public boolean handleEvent(java.lang.String eventName)
Description copied from class:ScriptableDelegateExecutes the event Handler script for the specified event (such as onchange, onmousedown, onclick, onmouseup) if it is defined.- Specified by:
handleEventin interfaceScriptingEventHandler- Overrides:
handleEventin classScriptableDelegate- Parameters:
eventName- the name of the event for which a handler should be run.- Returns:
- whether the event with the given name was handled
-
-