1. /*
  2. * Copyright (c) 2000 World Wide Web Consortium,
  3. * (Massachusetts Institute of Technology, Institut National de
  4. * Recherche en Informatique et en Automatique, Keio University). All
  5. * Rights Reserved. This program is distributed under the W3C's Software
  6. * Intellectual Property License. This program is distributed in the
  7. * hope that it will be useful, but WITHOUT ANY WARRANTY; without even
  8. * the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
  9. * PURPOSE.
  10. * See W3C License http://www.w3.org/Consortium/Legal/ for more details.
  11. */
  12. package org.w3c.dom.events;
  13. import org.w3c.dom.DOMException;
  14. /**
  15. * The <code>DocumentEvent</code> interface provides a mechanism by which the
  16. * user can create an Event of a type supported by the implementation. It is
  17. * expected that the <code>DocumentEvent</code> interface will be
  18. * implemented on the same object which implements the <code>Document</code>
  19. * interface in an implementation which supports the Event model.
  20. * <p>See also the <a href='http://www.w3.org/TR/2000/REC-DOM-Level-2-Events-20001113'>Document Object Model (DOM) Level 2 Events Specification</a>.
  21. * @since DOM Level 2
  22. */
  23. public interface DocumentEvent {
  24. /**
  25. *
  26. * @param eventTypeThe <code>eventType</code> parameter specifies the
  27. * type of <code>Event</code> interface to be created. If the
  28. * <code>Event</code> interface specified is supported by the
  29. * implementation this method will return a new <code>Event</code> of
  30. * the interface type requested. If the <code>Event</code> is to be
  31. * dispatched via the <code>dispatchEvent</code> method the
  32. * appropriate event init method must be called after creation in
  33. * order to initialize the <code>Event</code>'s values. As an example,
  34. * a user wishing to synthesize some kind of <code>UIEvent</code>
  35. * would call <code>createEvent</code> with the parameter "UIEvents".
  36. * The <code>initUIEvent</code> method could then be called on the
  37. * newly created <code>UIEvent</code> to set the specific type of
  38. * UIEvent to be dispatched and set its context information.The
  39. * <code>createEvent</code> method is used in creating
  40. * <code>Event</code>s when it is either inconvenient or unnecessary
  41. * for the user to create an <code>Event</code> themselves. In cases
  42. * where the implementation provided <code>Event</code> is
  43. * insufficient, users may supply their own <code>Event</code>
  44. * implementations for use with the <code>dispatchEvent</code> method.
  45. * @return The newly created <code>Event</code>
  46. * @exception DOMException
  47. * NOT_SUPPORTED_ERR: Raised if the implementation does not support the
  48. * type of <code>Event</code> interface requested
  49. */
  50. public Event createEvent(String eventType)
  51. throws DOMException;
  52. }