com.aspose.html.dom

Class EventTarget

  • All Implemented Interfaces:
    IEventTarget, com.aspose.html.internal.ms.System.IDisposable
    Direct Known Subclasses:
    Node


    @DOMObjectAttribute
     @DOMNameAttribute(name="EventTarget")
    public class EventTarget
    extends DOMObject
    implements IEventTarget, com.aspose.html.internal.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.

    • Field Detail

      • EventMap

        public com.aspose.html.dom.events.EventMap EventMap
    • Method Detail

      • addEventListener

        public void addEventListener(String type,
                                     DOMEventHandler handler,
                                     boolean useCapture)

        This method allows the registration of event listeners on the event target.

        Parameters:
        type - The event type for which the user is registering
        handler - 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.

      • addEventListener

        public void addEventListener(String type,
                                     IEventListener listener)

        This method allows the registration of event listeners on the event target.

        Specified by:
        addEventListener in interface IEventTarget
        Parameters:
        type - The event type for which the user is registering
        listener - 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.

      • addEventListener

        public void addEventListener(String type,
                                     IEventListener listener,
                                     boolean useCapture)

        This method allows the registration of event listeners on the event target.

        Specified by:
        addEventListener in interface IEventTarget
        Parameters:
        type - The event type for which the user is registering
        listener - 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.

      • addEventListener

        public void addEventListener(String type,
                                     DOMEventHandler handler,
                                     com.aspose.html.dom.events.EventListenerOptions options)
      • removeEventListener

        public void removeEventListener(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.

        Parameters:
        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.
      • removeEventListener

        public void removeEventListener(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.

        Specified by:
        removeEventListener in interface IEventTarget
        Parameters:
        type - 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.
      • dispose

        public void dispose()

        Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.

        Specified by:
        dispose in interface com.aspose.html.internal.ms.System.IDisposable