public interface DocumentEvent
DocumentEventinterface provides a mechanism by which the user can create an
Eventobject of a type supported by the implementation. If the feature "Events" is supported by the
DocumentEventinterface must be implemented on the same object. Note that JSR 280 does not support the 3.0 Events feature, but the object returned to a 2.0 Events request will include the DocumentEvent interface implementation.
See also the Document Object Model (DOM) Level 3 Events Specification.
Event createEvent(java.lang.String eventType) throws DOMException
eventTypeparameter specifies the name of the DOM Events interface to be supported by the created event object, e.g.
"MutationEvent"and so on. If the
Eventis 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.initUIEventNS()method could then be called on the newly created
UIEventobject to set the specific type of user interface event to be dispatched, DOMActivate for example, and set its context information, e.g.
UIEvent.detailin 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".
Note: JSR 280 follows the DOM 3 rule for
and considers it to be case-sensitive. This differs from DOM 2, which
considers it to be case-insensitive.
DOMException- NOT_SUPPORTED_ERR: Raised if the implementation does not support the
boolean canDispatch(java.lang.String namespaceURI, java.lang.String type)
namespaceURI- Specifies the
Event.namespaceURIof the event, may be null.
type- Specifies the
Event.typeof the event.
trueif the implementation can generate and dispatch this event type,
Copyright © 2013, Oracle and/or its affiliates. All rights reserved.
Use is subject to License Terms. Your use of this web site or any of its contents or software indicates your agreement to be bound by these License Terms.