com.aspose.html.dom

Class EventTarget

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


    @DOMObjectAttribute
     @DOMNameAttribute(name="EventTarget")
    public class EventTarget
    extends DOMObject
    implements com.aspose.ms.System.IDisposable, IEventTarget

    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

      • _EventListenerInvoker

        public EventListenerInvoker _EventListenerInvoker
    • Constructor Detail

      • EventTarget

        public EventTarget()
    • Method Detail

      • getEventsDescriptor

        public _EventMapDescriptor getEventsDescriptor()
      • setEventsDescriptor

        public void setEventsDescriptor(_EventMapDescriptor value)
      • getTargetOverride

        public EventTarget getTargetOverride()
      • setTargetOverride

        public void setTargetOverride(EventTarget value)
      • 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, bool) 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, bool) 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, bool) method.

      • 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)

        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.
      • 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.
      • dispatchEvent

        public boolean dispatchEvent(Event event)

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

        Specified by:
        dispatchEvent in interface IEventTarget
        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 DispatchEvent is called.

        Returns:
        The return value of 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
      • dispose

        public void dispose()

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

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