com.gargoylesoftware.htmlunit.javascript.host
Class EventHandler

java.lang.Object
  extended by org.mozilla.javascript.ScriptableObject
      extended by org.mozilla.javascript.IdScriptableObject
          extended by org.mozilla.javascript.BaseFunction
              extended by com.gargoylesoftware.htmlunit.javascript.host.EventHandler
All Implemented Interfaces:
java.io.Serializable, org.mozilla.javascript.Callable, org.mozilla.javascript.ConstProperties, org.mozilla.javascript.debug.DebuggableObject, org.mozilla.javascript.Function, org.mozilla.javascript.IdFunctionCall, org.mozilla.javascript.Scriptable

public class EventHandler
extends org.mozilla.javascript.BaseFunction

Allows to wrap event handler code as Function object.

Version:
$Revision: 1.3 $
Author:
Marc Guillemot
See Also:
Serialized Form

Field Summary
 
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
EventHandler(DomNode node, java.lang.String eventName, java.lang.String jsSnippet)
 Builds a function that will execute the javascript code provided
 
Method Summary
 java.lang.Object call(org.mozilla.javascript.Context cx, org.mozilla.javascript.Scriptable scope, org.mozilla.javascript.Scriptable thisObj, java.lang.Object[] args)
 
 java.lang.Object get(java.lang.String name, org.mozilla.javascript.Scriptable start)
 
 java.lang.Object getDefaultValue(java.lang.Class typeHint)
  
 
Methods inherited from class org.mozilla.javascript.BaseFunction
construct, createObject, execIdCall, getArity, getClassName, getFunctionName, getLength, hasInstance, setImmunePrototypeProperty
 
Methods inherited from class org.mozilla.javascript.IdScriptableObject
activatePrototypeMap, delete, exportAsJSClass, getAttributes, has, hasPrototypeMap, initPrototypeConstructor, initPrototypeMethod, initPrototypeValue, put, setAttributes
 
Methods inherited from class org.mozilla.javascript.ScriptableObject
associateValue, avoidObjectDetection, callMethod, callMethod, defineClass, defineClass, defineClass, defineConst, defineConstProperty, defineFunctionProperties, defineProperty, defineProperty, defineProperty, defineProperty, delete, deleteProperty, deleteProperty, get, getAllIds, getAssociatedValue, getAttributes, getAttributes, getAttributes, getClassPrototype, getDefaultValue, getFunctionPrototype, getGetterOrSetter, getIds, getObjectPrototype, getParentScope, getProperty, getProperty, getPropertyIds, getPrototype, getTopLevelScope, getTopScopeValue, has, hasProperty, hasProperty, isConst, isSealed, put, putConst, putConstProperty, putProperty, putProperty, redefineProperty, sealObject, setAttributes, setAttributes, setAttributes, setGetterOrSetter, setParentScope, setPrototype
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.mozilla.javascript.Scriptable
delete, delete, get, getIds, getParentScope, getPrototype, has, has, put, put, setParentScope, setPrototype
 

Constructor Detail

EventHandler

public EventHandler(DomNode node,
                    java.lang.String eventName,
                    java.lang.String jsSnippet)
Builds a function that will execute the javascript code provided

Parameters:
node - the element for which the event is build
eventName - the event for which this handler is created
jsSnippet - the javascript code
Method Detail

call

public java.lang.Object call(org.mozilla.javascript.Context cx,
                             org.mozilla.javascript.Scriptable scope,
                             org.mozilla.javascript.Scriptable thisObj,
                             java.lang.Object[] args)
                      throws org.mozilla.javascript.JavaScriptException

Specified by:
call in interface org.mozilla.javascript.Callable
Specified by:
call in interface org.mozilla.javascript.Function
Overrides:
call in class org.mozilla.javascript.BaseFunction
Throws:
org.mozilla.javascript.JavaScriptException

get

public java.lang.Object get(java.lang.String name,
                            org.mozilla.javascript.Scriptable start)

Specified by:
get in interface org.mozilla.javascript.Scriptable
Overrides:
get in class org.mozilla.javascript.IdScriptableObject

getDefaultValue

public java.lang.Object getDefaultValue(java.lang.Class typeHint)
Specified by:
getDefaultValue in interface org.mozilla.javascript.Scriptable
Overrides:
getDefaultValue in class org.mozilla.javascript.ScriptableObject
Parameters:
typeHint - the type hint
Returns:
the js code of the function declaration
See Also:
ScriptableObject.getDefaultValue(java.lang.Class)


Copyright © 2003-2016 AppPerfect Corporation. All Rights Reserved.