com.meterware.httpunit.javascript
Class JavaScript.Control

java.lang.Object
  extended by org.mozilla.javascript.ScriptableObject
      extended by com.meterware.httpunit.javascript.ScriptingEngineImpl
          extended by com.meterware.httpunit.javascript.JavaScript.Control
All Implemented Interfaces:
ScriptingEngine, ScriptingEventHandler, ScriptingHandler, java.io.Serializable, org.mozilla.javascript.ConstProperties, org.mozilla.javascript.debug.DebuggableObject, org.mozilla.javascript.Scriptable
Enclosing class:
JavaScript

public static class JavaScript.Control
extends ScriptingEngineImpl

Javascript support for any control

See Also:
Serialized Form

Field Summary
protected  com.meterware.httpunit.javascript.JavaScript.JavaScriptEngine _parent
           
protected  ScriptableDelegate _scriptable
           
 
Fields inherited from class org.mozilla.javascript.ScriptableObject
CONST, DONTENUM, EMPTY, PERMANENT, READONLY, UNINITIALIZED_CONST
 
Fields inherited from interface org.mozilla.javascript.Scriptable
NOT_FOUND
 
Constructor Summary
JavaScript.Control()
           
 
Method Summary
 void clearCaches()
          Clears any cached values, permitting them to be recomputed as needed.
 java.lang.Object get(int i, org.mozilla.javascript.Scriptable scriptable)
           
 java.lang.Object get(java.lang.String propertyName, org.mozilla.javascript.Scriptable scriptable)
           
 java.lang.String getClassName()
           
 boolean handleEvent(java.lang.String eventName)
          get the event Handler script for the event e.g.
 boolean has(java.lang.String propertyName, org.mozilla.javascript.Scriptable scriptable)
           
 void jsFunction_click()
          click via javascript
 void jsFunction_focus()
           
 java.lang.Object jsFunction_getAttribute(java.lang.String attributeName)
          Support getting value of arbitrary attribute
 void jsFunction_onchange()
          Allow calling onchange() from within a JavaScript function
 void jsFunction_removeAttribute(java.lang.String attributeName)
          Support getting value of arbitrary attribute
 void jsFunction_select()
           
 void jsFunction_setAttribute(java.lang.String attributeName, java.lang.Object value)
          Support getting value of arbitrary attribute
 JavaScript.Form jsGet_form()
           
 ScriptingEngine newScriptingEngine(ScriptableDelegate child)
          Returns a new scripting engine for the specified delegate.
 void put(java.lang.String propertyName, org.mozilla.javascript.Scriptable scriptable, java.lang.Object value)
           
protected  JavaScript.ElementArray toElementArray(ScriptingHandler[] scriptables)
           
 java.lang.String toString()
           
protected static java.lang.String toStringIfNotUndefined(java.lang.Object object)
           
 
Methods inherited from class com.meterware.httpunit.javascript.ScriptingEngineImpl
clearErrorMessages, discardDocumentWriteBuffer, doEvent, doEventScript, evaluateExpression, getDocumentWriteBuffer, getErrorMessages, handleScriptException, runScript, supportsScriptLanguage
 
Methods inherited from class org.mozilla.javascript.ScriptableObject
associateValue, avoidObjectDetection, callMethod, callMethod, defineClass, defineClass, defineClass, defineConst, defineConstProperty, defineFunctionProperties, defineProperty, defineProperty, defineProperty, defineProperty, delete, delete, deleteProperty, deleteProperty, equivalentValues, getAllIds, getAssociatedValue, getAttributes, getAttributes, getAttributes, getAttributes, getClassPrototype, getDefaultValue, getDefaultValue, getFunctionPrototype, getGetterOrSetter, getIds, getObjectPrototype, getParentScope, getProperty, getProperty, getPropertyIds, getPrototype, getTopLevelScope, getTopScopeValue, has, hasInstance, hasProperty, hasProperty, isConst, isGetterOrSetter, isSealed, put, putConst, putConstProperty, putProperty, putProperty, redefineProperty, sealObject, setAttributes, setAttributes, setAttributes, setAttributes, setGetterOrSetter, setParentScope, setPrototype
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

_scriptable

protected ScriptableDelegate _scriptable

_parent

protected com.meterware.httpunit.javascript.JavaScript.JavaScriptEngine _parent
Constructor Detail

JavaScript.Control

public JavaScript.Control()
Method Detail

getClassName

public java.lang.String getClassName()
Specified by:
getClassName in interface org.mozilla.javascript.Scriptable
Specified by:
getClassName in class org.mozilla.javascript.ScriptableObject

jsGet_form

public JavaScript.Form jsGet_form()

jsFunction_focus

public void jsFunction_focus()

jsFunction_select

public void jsFunction_select()

jsFunction_click

public void jsFunction_click()
                      throws java.io.IOException,
                             org.xml.sax.SAXException
click via javascript

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

jsFunction_getAttribute

public java.lang.Object jsFunction_getAttribute(java.lang.String attributeName)
                                         throws org.mozilla.javascript.JavaScriptException
Support getting value of arbitrary attribute

Throws:
org.mozilla.javascript.JavaScriptException

jsFunction_setAttribute

public void jsFunction_setAttribute(java.lang.String attributeName,
                                    java.lang.Object value)
                             throws org.mozilla.javascript.JavaScriptException
Support getting value of arbitrary attribute

Throws:
org.mozilla.javascript.JavaScriptException

jsFunction_removeAttribute

public void jsFunction_removeAttribute(java.lang.String attributeName)
                                throws org.mozilla.javascript.JavaScriptException
Support getting value of arbitrary attribute

Throws:
org.mozilla.javascript.JavaScriptException

jsFunction_onchange

public void jsFunction_onchange()
                         throws org.mozilla.javascript.JavaScriptException
Allow calling onchange() from within a JavaScript function

Throws:
org.mozilla.javascript.JavaScriptException

handleEvent

public boolean handleEvent(java.lang.String eventName)
get the event Handler script for the event e.g. onchange, onmousedown, onclick, onmouseup execute the script if it's assigned by calling doEvent for the script

Specified by:
handleEvent in interface ScriptingEventHandler
Overrides:
handleEvent in class ScriptingEngineImpl
Parameters:
eventName -
Returns:

has

public boolean has(java.lang.String propertyName,
                   org.mozilla.javascript.Scriptable scriptable)
Specified by:
has in interface org.mozilla.javascript.Scriptable
Overrides:
has in class org.mozilla.javascript.ScriptableObject

get

public java.lang.Object get(java.lang.String propertyName,
                            org.mozilla.javascript.Scriptable scriptable)
Specified by:
get in interface org.mozilla.javascript.Scriptable
Overrides:
get in class org.mozilla.javascript.ScriptableObject

get

public java.lang.Object get(int i,
                            org.mozilla.javascript.Scriptable scriptable)
Specified by:
get in interface org.mozilla.javascript.Scriptable
Overrides:
get in class org.mozilla.javascript.ScriptableObject

put

public void put(java.lang.String propertyName,
                org.mozilla.javascript.Scriptable scriptable,
                java.lang.Object value)
Specified by:
put in interface org.mozilla.javascript.Scriptable
Overrides:
put in class org.mozilla.javascript.ScriptableObject

toString

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

newScriptingEngine

public ScriptingEngine newScriptingEngine(ScriptableDelegate child)
Description copied from interface: ScriptingEngine
Returns a new scripting engine for the specified delegate.


clearCaches

public void clearCaches()
Description copied from interface: ScriptingEngine
Clears any cached values, permitting them to be recomputed as needed.


toStringIfNotUndefined

protected static java.lang.String toStringIfNotUndefined(java.lang.Object object)

toElementArray

protected JavaScript.ElementArray toElementArray(ScriptingHandler[] scriptables)


Copyright © 2011. All Rights Reserved.