com.gargoylesoftware.htmlunit.javascript.host
Class EventHandler

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

public class EventHandler
extends net.sourceforge.htmlunit.corejs.javascript.BaseFunction

Allows to wrap event handler code as Function object.

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

Nested Class Summary
 
Nested classes/interfaces inherited from interface java.util.Map
Map.Entry<K,V>
 
Field Summary
 
Fields inherited from class net.sourceforge.htmlunit.corejs.javascript.ScriptableObject
CONST, DONTENUM, EMPTY, PERMANENT, READONLY, UNINITIALIZED_CONST
 
Fields inherited from interface net.sourceforge.htmlunit.corejs.javascript.Scriptable
NOT_FOUND
 
Constructor Summary
EventHandler(DomNode node, String eventName, String jsSnippet)
          Builds a function that will execute the JavaScript code provided.
 
Method Summary
 Object call(net.sourceforge.htmlunit.corejs.javascript.Context cx, net.sourceforge.htmlunit.corejs.javascript.Scriptable scope, net.sourceforge.htmlunit.corejs.javascript.Scriptable thisObj, Object[] args)
          
 Object get(String name, net.sourceforge.htmlunit.corejs.javascript.Scriptable start)
          
 Object getDefaultValue(Class<?> typeHint)
           
 
Methods inherited from class net.sourceforge.htmlunit.corejs.javascript.BaseFunction
construct, createObject, execIdCall, fillConstructorProperties, findInstanceIdInfo, findPrototypeId, getArity, getClassName, getClassPrototype, getFunctionName, getInstanceIdName, getInstanceIdValue, getLength, getMaxInstanceId, getTypeOf, hasInstance, initPrototypeId, setImmunePrototypeProperty, setInstanceIdValue
 
Methods inherited from class net.sourceforge.htmlunit.corejs.javascript.IdScriptableObject
activatePrototypeMap, addIdFunctionProperty, defaultGet, defaultPut, defineOwnProperty, delete, exportAsJSClass, getAttributes, getOwnPropertyDescriptor, has, hasPrototypeMap, incompatibleCallError, initPrototypeConstructor, initPrototypeMethod, initPrototypeValue, instanceIdInfo, put, setAttributes
 
Methods inherited from class net.sourceforge.htmlunit.corejs.javascript.ScriptableObject
applyDescriptorToAttributeBitset, associateValue, avoidObjectDetection, buildDataDescriptor, callMethod, callMethod, clear, containsKey, containsValue, defineClass, defineClass, defineClass, defineConst, defineConstProperty, defineFunctionProperties, defineOwnProperties, defineProperty, defineProperty, defineProperty, defineProperty, delete, deleteProperty, deleteProperty, ensureScriptable, ensureScriptableObject, entrySet, equivalentValues, get, get, getAllIds, getArrayPrototype, getAssociatedValue, getAttributes, getAttributes, getAttributes, getClassPrototype, getDefaultValue, getFunctionPrototype, getGetterOrSetter, getIds, getObjectPrototype, getParentScope, getProperty, getProperty, getPropertyIds, getPrototype, getSlot, getTopLevelScope, getTopScopeValue, has, hasProperty, hasProperty, isAccessorDescriptor, isConst, isDataDescriptor, isEmpty, isExtensible, isFalse, isGenericDescriptor, isGetterOrSetter, isSealed, isTrue, keySet, preventExtensions, put, put, putAll, putConst, putConstProperty, putProperty, putProperty, redefineProperty, remove, sealObject, setAttributes, setAttributes, setAttributes, setGetterOrSetter, setParentScope, setPrototype, size, values
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface net.sourceforge.htmlunit.corejs.javascript.Scriptable
delete, delete, get, getIds, getParentScope, getPrototype, has, has, put, put, setParentScope, setPrototype
 
Methods inherited from interface java.util.Map
equals, hashCode
 

Constructor Detail

EventHandler

public EventHandler(DomNode node,
                    String eventName,
                    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 Object call(net.sourceforge.htmlunit.corejs.javascript.Context cx,
                   net.sourceforge.htmlunit.corejs.javascript.Scriptable scope,
                   net.sourceforge.htmlunit.corejs.javascript.Scriptable thisObj,
                   Object[] args)
            throws net.sourceforge.htmlunit.corejs.javascript.JavaScriptException

Specified by:
call in interface net.sourceforge.htmlunit.corejs.javascript.Callable
Specified by:
call in interface net.sourceforge.htmlunit.corejs.javascript.Function
Overrides:
call in class net.sourceforge.htmlunit.corejs.javascript.BaseFunction
Throws:
net.sourceforge.htmlunit.corejs.javascript.JavaScriptException

getDefaultValue

public Object getDefaultValue(Class<?> typeHint)
Specified by:
getDefaultValue in interface net.sourceforge.htmlunit.corejs.javascript.Scriptable
Overrides:
getDefaultValue in class net.sourceforge.htmlunit.corejs.javascript.ScriptableObject
Parameters:
typeHint - the type hint
Returns:
the js code of the function declaration
See Also:
ScriptableObject.getDefaultValue(java.lang.Class)

get

public Object get(String name,
                  net.sourceforge.htmlunit.corejs.javascript.Scriptable start)

Specified by:
get in interface net.sourceforge.htmlunit.corejs.javascript.Scriptable
Overrides:
get in class net.sourceforge.htmlunit.corejs.javascript.IdScriptableObject


Copyright © 2002-2011 Gargoyle Software Inc.. All Rights Reserved.