Interface DocumentEvent

    • Method Summary

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method Description
      boolean canDispatch​(java.lang.String namespaceURI, java.lang.String type)
      Test if the implementation can generate events of a specified type.
      Event createEvent​(java.lang.String eventType)  
    • Method Detail

      • createEvent

        Event createEvent​(java.lang.String eventType)
                   throws org.w3c.dom.DOMException
        Parameters:
        eventType - The eventType parameter specifies the name of the DOM Events interface to be supported by the created event object, e.g. "Event", "MouseEvent", "MutationEvent" and so on. If the Event is to be dispatched via the EventTarget.dispatchEvent() method the appropriate event init method must be called after creation in order to initialize the Event's values. As an example, a user wishing to synthesize some kind of UIEvent would invoke DocumentEvent.createEvent("UIEvent"). The UIEvent.initUIEventNS() method could then be called on the newly created UIEvent object to set the specific type of user interface event to be dispatched, DOMActivate for example, and set its context information, e.g. UIEvent.detail in this example.

        Note: For backward compatibility reason, "UIEvents", "MouseEvents", "MutationEvents", and "HTMLEvents" feature names are valid values for the parameter eventType and represent respectively the interfaces "UIEvent", "MouseEvent", "MutationEvent", and "Event".

        Returns:
        The newly created event object.
        Throws:
        org.w3c.dom.DOMException - NOT_SUPPORTED_ERR: Raised if the implementation does not support the Event interface requested.
      • canDispatch

        boolean canDispatch​(java.lang.String namespaceURI,
                            java.lang.String type)
        Test if the implementation can generate events of a specified type.
        Parameters:
        namespaceURI - Specifies the Event.namespaceURI of the event.
        type - Specifies the Event.type of the event.
        Returns:
        true if the implementation can generate and dispatch this event type, false otherwise.
        Since:
        DOM Level 3