class EventTargetWrapper
extends org.mozilla.javascript.NativeJavaObject
EventTarget
instance to expose
it in the Rhino engine. Then calling addEventListener
with a Rhino function as parameter should redirect the call to
addEventListener
with a Java function object calling
the Rhino function.
This class also allows to pass an ECMAScript (Rhino) object as
a parameter instead of a function provided the fact that this object
has a handleEvent
method.Modifier and Type | Class and Description |
---|---|
(package private) static class |
EventTargetWrapper.FunctionAddNSProxy |
(package private) static class |
EventTargetWrapper.FunctionAddProxy
This function proxy is delegating most of the job
to the underlying NativeJavaMethod object through
the FunctionProxy.
|
(package private) static class |
EventTargetWrapper.FunctionEventListener
The Java function object calling the Rhino function.
|
(package private) static class |
EventTargetWrapper.FunctionProxy |
(package private) static class |
EventTargetWrapper.FunctionRemoveNSProxy |
(package private) static class |
EventTargetWrapper.FunctionRemoveProxy |
(package private) static class |
EventTargetWrapper.HandleEventListener |
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
ADD_NAME |
static java.lang.String |
ADDNS_NAME |
protected RhinoInterpreter |
interpreter |
protected static java.util.WeakHashMap |
mapOfListenerMap |
static java.lang.String |
REMOVE_NAME |
static java.lang.String |
REMOVENS_NAME |
Constructor and Description |
---|
EventTargetWrapper(org.mozilla.javascript.Scriptable scope,
EventTarget object,
RhinoInterpreter interpreter) |
Modifier and Type | Method and Description |
---|---|
java.lang.Object |
get(java.lang.String name,
org.mozilla.javascript.Scriptable start)
Overriden Rhino method.
|
java.util.Map |
initMap() |
protected static java.util.WeakHashMap mapOfListenerMap
public static final java.lang.String ADD_NAME
public static final java.lang.String ADDNS_NAME
public static final java.lang.String REMOVE_NAME
public static final java.lang.String REMOVENS_NAME
protected RhinoInterpreter interpreter
EventTargetWrapper(org.mozilla.javascript.Scriptable scope, EventTarget object, RhinoInterpreter interpreter)
public java.lang.Object get(java.lang.String name, org.mozilla.javascript.Scriptable start)
get
in interface org.mozilla.javascript.Scriptable
get
in class org.mozilla.javascript.NativeJavaObject
public java.util.Map initMap()