EventTargetpublic interface EventTarget The EventTarget interface is implemented by all the objects
which could be event targets in an implementation which supports an event
flow. The interface allows registration and removal of event listeners,
and dispatch of events to an event target.
When used with the DOM event flow, this interface is implemented by all
target nodes and target ancestors, i.e. all DOM Nodes of the
tree support this interface when the implementation conforms to DOM Level
3 Events and, therefore, this interface can be obtained by using
binding-specific casting methods on an instance of the Node
interface.
Invoking addEventListener or
addEventListenerNS repeatedly on the same
EventTarget with the same values for the parameters
namespaceURI , type , listener , and
useCapture has no effect. Doing so does not cause the
EventListener to be called more than once and does not cause
a change in the triggering order.
See also the
Document Object Model (DOM) Level 3 Events Specification
. |
Methods Summary |
---|
public void | addEventListener(java.lang.String type, org.w3c.dom.events.EventListener listener, boolean useCapture)Registers an event listener, depending on the useCapture
parameter, on the capture phase of the DOM event flow or its target
and bubbling phases. Invoking this method is equivalent to invoking
addEventListenerNS with the same values for the
parameters type , listener , and
useCapture , and the value null for the
parameter namespaceURI .
| public boolean | dispatchEvent(org.w3c.dom.events.Event evt)Dispatches an event into the implementation's event model. The event
target of the event is the EventTarget object on which
dispatchEvent is called.
| public void | removeEventListener(java.lang.String type, org.w3c.dom.events.EventListener listener, boolean useCapture)Removes an event listener. Calling removeEventListener
with arguments which do not identify any currently registered
EventListener on the EventTarget has no
effect. The Event.namespaceURI for which the user
registered the event listener is implied and is null .
|
|