@DOMObjectAttribute @DOMNameAttribute(name="EventTarget") public class EventTarget extends DOMObject implements IEventTarget, com.aspose.ms.System.IDisposable
The EventTarget interface is implemented by all Nodes in an implementation which supports the DOM Event Model.
Therefore, this interface can be obtained by using binding-specific casting methods on an instance of the Node interface.
The interface allows registration and removal of Event Listeners on an EventTarget and dispatch of events to that IEventTarget.
| Modifier and Type | Field and Description |
|---|---|
com.aspose.html.dom.events.EventMap |
EventMap |
PropertyChanged, PropertyChangedDelegate| Modifier | Constructor and Description |
|---|---|
protected |
EventTarget()
Initializes a new instance of the
EventTarget class. |
| Modifier and Type | Method and Description |
|---|---|
void |
addEventListener(java.lang.String type,
DOMEventHandler handler,
boolean useCapture)
This method allows the registration of event listeners on the event target.
|
void |
addEventListener(java.lang.String type,
DOMEventHandler handler,
com.aspose.html.dom.events.EventListenerOptions options) |
void |
addEventListener(java.lang.String type,
IEventListener listener)
This method allows the registration of event listeners on the event target.
|
void |
addEventListener(java.lang.String type,
IEventListener listener,
boolean useCapture)
This method allows the registration of event listeners on the event target.
|
boolean |
dispatchEvent(Event event)
This method allows the dispatch of events into the implementations event model.
|
void |
dispose()
Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.
|
protected void |
dispose(boolean disposing)
Releases unmanaged and - optionally - managed resources.
|
void |
removeEventListener(java.lang.String type,
DOMEventHandler handler,
boolean useCapture)
This method allows the removal of event listeners from the event target.
|
void |
removeEventListener(java.lang.String type,
IEventListener listener)
This method allows the removal of event listeners from the event target.
|
void |
removeEventListener(java.lang.String type,
IEventListener listener,
boolean useCapture)
This method allows the removal of event listeners from the event target.
|
fireNotifyPropertyChanged, getCurrentValues, getRuntimesBinding, setCurrentValues, setField, setRuntimesBindingprotected EventTarget()
Initializes a new instance of the EventTarget class.
public void addEventListener(java.lang.String type,
DOMEventHandler handler,
boolean useCapture)
This method allows the registration of event listeners on the event target.
type - The event type for which the user is registeringhandler - Takes an DOMEventHandler to be called when the event occurs.useCapture - If true, useCapture indicates that the user wishes to initiate capture.
After initiating capture, all events of the specified type will be dispatched to the registered
IEventListener
before being dispatched to any Event Targets beneath them in the tree.
Events which are bubbling upward through the tree will not trigger an IEventListener designated to use capture.
If an IEventListener is added to an EventTarget while it is processing an event, it will not be triggered
by the current actions but may be triggered during a later stage of event flow, such as the bubbling phase.
If multiple identical Event Listeners are registered on the same EventTarget with the same parameters the duplicate instances are discarded.
They do not cause the IEventListener to be called twice and since they are discarded they do not need to be removed with the
removeEventListener(String, DOMEventHandler, boolean)
method.
public void addEventListener(java.lang.String type,
IEventListener listener)
This method allows the registration of event listeners on the event target.
addEventListener in interface IEventTargettype - The event type for which the user is registeringlistener - Takes an interface implemented by the user which contains the methods to be called when the event occurs.
If an IEventListener is added to an EventTarget while it is processing an event, it will not be triggered
by the current actions but may be triggered during a later stage of event flow, such as the bubbling phase.
If multiple identical Event Listeners are registered on the same EventTarget with the same parameters the duplicate instances are discarded.
They do not cause the IEventListener to be called twice and since they are discarded they do not need to be removed with the
removeEventListener(String, DOMEventHandler, boolean)
method.
public void addEventListener(java.lang.String type,
IEventListener listener,
boolean useCapture)
This method allows the registration of event listeners on the event target.
addEventListener in interface IEventTargettype - The event type for which the user is registeringlistener - Takes an interface implemented by the user which contains the methods to be called when the event occurs.useCapture - If true, useCapture indicates that the user wishes to initiate capture.
After initiating capture, all events of the specified type will be dispatched to the registered
IEventListener
before being dispatched to any Event Targets beneath them in the tree.
Events which are bubbling upward through the tree will not trigger an IEventListener designated to use capture.
If an IEventListener is added to an EventTarget while it is processing an event, it will not be triggered
by the current actions but may be triggered during a later stage of event flow, such as the bubbling phase.
If multiple identical Event Listeners are registered on the same EventTarget with the same parameters the duplicate instances are discarded.
They do not cause the IEventListener to be called twice and since they are discarded they do not need to be removed with the
removeEventListener(String, DOMEventHandler, boolean)
method.
public void addEventListener(java.lang.String type,
DOMEventHandler handler,
com.aspose.html.dom.events.EventListenerOptions options)
public void removeEventListener(java.lang.String type,
DOMEventHandler handler,
boolean useCapture)
This method allows the removal of event listeners from the event target.
If an IEventListener is removed from an EventTarget while it is processing an event, it will not be triggered by the current actions.
Event Listeners can never be invoked after being removed.
type - Specifies the event type of the IEventListener being removed.handler - The DOMEventHandler parameter indicates the IEventListener to be removed.useCapture - Specifies whether the EventListener being removed was registered as a capturing listener or not.
If a listener was registered twice, one with capture and one without, each must be removed separately.
Removal of a capturing listener does not affect a non-capturing version of the same listener, and vice versa.public void removeEventListener(java.lang.String type,
IEventListener listener)
This method allows the removal of event listeners from the event target.
If an IEventListener is removed from an EventTarget while it is processing an event, it will not be triggered by the current actions.
Event Listeners can never be invoked after being removed.
removeEventListener in interface IEventTargettype - Specifies the event type of the IEventListener being removed.listener - The IEventListener parameter indicates the IEventListener to be removed.public void removeEventListener(java.lang.String type,
IEventListener listener,
boolean useCapture)
This method allows the removal of event listeners from the event target.
If an IEventListener is removed from an EventTarget while it is processing an event, it will not be triggered by the current actions.
Event Listeners can never be invoked after being removed.
removeEventListener in interface IEventTargettype - Specifies the event type of the IEventListener being removed.listener - The IEventListener parameter indicates the IEventListener to be removed.useCapture - Specifies whether the EventListener being removed was registered as a capturing listener or not.
If a listener was registered twice, one with capture and one without, each must be removed separately.
Removal of a capturing listener does not affect a non-capturing version of the same listener, and vice versa.public boolean dispatchEvent(Event event)
This method allows the dispatch of events into the implementations event model.
dispatchEvent in interface IEventTargetevent - Specifies the event type, behavior, and contextual information to be used in processing the event.
EventTarget on which dispatchEvent(com.aspose.html.dom.events.Event) is called.
dispatchEvent(com.aspose.html.dom.events.Event) indicates whether any of the listeners which handled the event called Event.preventDefault().
If Event.preventDefault() was called the value is false, else the value is true.DOMExceptionpublic void dispose()
Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.
dispose in interface com.aspose.ms.System.IDisposableprotected void dispose(boolean disposing)
Releases unmanaged and - optionally - managed resources.
disposing - true to release both managed and unmanaged resources; false to release only unmanaged resources.