public class EventListenersContainer extends Object implements Serializable
Constructor and Description |
---|
EventListenersContainer(EventTarget jsNode)
The constructor.
|
Modifier and Type | Method and Description |
---|---|
boolean |
addEventListener(String type,
net.sourceforge.htmlunit.corejs.javascript.Scriptable listener,
boolean useCapture)
Adds an event listener.
|
void |
copyFrom(EventListenersContainer eventListenersContainer)
Copies all the events from the provided container.
|
ScriptResult |
executeBubblingListeners(Event event,
Object[] args,
Object[] propHandlerArgs)
Executes bubbling listeners.
|
ScriptResult |
executeCapturingListeners(Event event,
Object[] args)
Executes capturing listeners.
|
ScriptResult |
executeListeners(Event event,
Object[] args,
Object[] propHandlerArgs)
Executes listeners.
|
net.sourceforge.htmlunit.corejs.javascript.Function |
getEventHandler(String eventName)
Gets an event handler.
|
Object |
getEventHandlerProp(String eventName)
Returns event handler property.
|
List<net.sourceforge.htmlunit.corejs.javascript.Scriptable> |
getHandlers(String eventType,
boolean useCapture)
Returns the relevant handlers.
|
boolean |
hasEventHandlers(String eventName)
Returns
true if there are any event handlers for the specified event. |
void |
removeEventListener(String eventType,
net.sourceforge.htmlunit.corejs.javascript.Scriptable listener,
boolean useCapture)
Removes event listener.
|
void |
setEventHandlerProp(String eventName,
Object value)
Sets the handler property (with an handler or something else).
|
String |
toString() |
public EventListenersContainer(EventTarget jsNode)
jsNode
- the node.public boolean addEventListener(String type, net.sourceforge.htmlunit.corejs.javascript.Scriptable listener, boolean useCapture)
type
- the event type to listen for (like "load")listener
- the event listeneruseCapture
- If true
, indicates that the user wishes to initiate capture (not yet implemented)true
if the listener has been addedpublic List<net.sourceforge.htmlunit.corejs.javascript.Scriptable> getHandlers(String eventType, boolean useCapture)
eventType
- the event typeuseCapture
- whether to use capture of notpublic void removeEventListener(String eventType, net.sourceforge.htmlunit.corejs.javascript.Scriptable listener, boolean useCapture)
eventType
- the typelistener
- the listeneruseCapture
- to use capture or notpublic void setEventHandlerProp(String eventName, Object value)
eventName
- the event name (like "click")value
- the new propertypublic Object getEventHandlerProp(String eventName)
eventName
- event namepublic ScriptResult executeBubblingListeners(Event event, Object[] args, Object[] propHandlerArgs)
event
- the eventargs
- argumentspropHandlerArgs
- handler argumentspublic ScriptResult executeCapturingListeners(Event event, Object[] args)
event
- the eventargs
- the argumentspublic net.sourceforge.htmlunit.corejs.javascript.Function getEventHandler(String eventName)
eventName
- the event name (e.g. "click")null
if the property is null or not a functionpublic boolean hasEventHandlers(String eventName)
true
if there are any event handlers for the specified event.eventName
- the event name (e.g. "click")true
if there are any event handlers for the specified event, false
otherwisepublic ScriptResult executeListeners(Event event, Object[] args, Object[] propHandlerArgs)
event
- the eventargs
- the argumentspropHandlerArgs
- handler argumentspublic void copyFrom(EventListenersContainer eventListenersContainer)
eventListenersContainer
- where to copy fromCopyright © 2002–2016 Gargoyle Software Inc.. All rights reserved.