com.aspose.html.dom.events

Interface IEventTarget

    • Method Detail

      • addEventListener

        void addEventListener(String type,
                              IEventListener listener)

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

        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, IEventListener) method.

      • addEventListener

        @DOMNameAttribute(name="addEventListener")
        void addEventListener(String type,
                                                                          @DOMNullableAttribute
                                                                          IEventListener listener,
                                                                          @DOMParameterAttribute(name="useCapture",optional=false)
                                                                          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
        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, IEventListener) method.

      • removeEventListener

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

        Parameters:
        type - Specifies the event type of the IEventListener being removed.
        listener - The IEventListener parameter indicates the IEventListener to be removed.
      • removeEventListener

        @DOMNameAttribute(name="removeEventListener")
        void removeEventListener(String type,
                                                                                @DOMNullableAttribute
                                                                                IEventListener listener,
                                                                                @DOMParameterAttribute(name="useCapture",optional=false)
                                                                                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.
        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.
      • dispatchEvent

        @DOMNameAttribute(name="dispatchEvent")
        boolean dispatchEvent(Event event)

        This method allows the dispatch of events into the implementations event model.

        Parameters:
        event - Specifies the event type, behavior, and contextual information to be used in processing the event.


        Events dispatched in this manner will have the same capturing and bubbling behavior as events dispatched directly by the implementation. The target of the event is the EventTarget on which EventTarget.DispatchEvent is called.

        Returns:
        The return value of EventTarget.DispatchEvent indicates whether any of the listeners which handled the event called IEvent.PreventDefault. If Event.PreventDefault was called the value is false, else the value is true.
        Throws:
        DOMException