You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

package.html 2.6KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
  2. <html>
  3. <head>
  4. </head>
  5. <body bgcolor="white">
  6. <!-- Package summary here -->
  7. <p>Provides classes and interfaces for the inheritable event
  8. model. The model supports inheritable events and a flexible way of
  9. registering and unregistering event listeners. It's a fundamental building
  10. block of the IT Mill Toolkit, and as it is included in
  11. {@link com.itmill.toolkit.ui.AbstractComponent}, all UI components
  12. automatically support it.</p>
  13. <h2>Package Specification</h2>
  14. <p>The core of the event model is the inheritable event class
  15. hierarchy, and the {@link com.itmill.toolkit.event.EventRouter EventRouter}
  16. which provide a simple, ubiquitous mechanism to transport events to all
  17. interested parties.</p>
  18. <p>The power of the event inheritance arises from the possibility of
  19. receiving not only the events of the registered type, <i>but also the
  20. ones which are inherited from it</i>. For example, let's assume that there
  21. are the events <code>GeneralEvent</code> and <code>SpecializedEvent</code>
  22. so that the latter inherits the former. Furthermore we have an object
  23. <code>A</code> which registers to receive <code>GeneralEvent</code> type
  24. events from the object <code>B</code>. <code>A</code> would of course
  25. receive all <code>GeneralEvent</code>s generated by <code>B</code>, but in
  26. addition to this, <code>A</code> would also receive all
  27. <code>SpecializedEvent</code>s generated by <code>B</code>. However, if
  28. <code>B</code> generates some other events that do not have
  29. <code>GeneralEvent</code> as an ancestor, <code>A</code> would not receive
  30. them unless it registers to listen for them, too.</p>
  31. <p>The interface to attaching and detaching listeners to and from an object
  32. works with methods. One specifies the event that should trigger the listener,
  33. the trigger method that should be called when a suitable event occurs and the
  34. object owning the method. From these a new listener is constructed and added
  35. to the event router of the specified component.</p>
  36. <p>The interface is defined in
  37. {@link com.itmill.toolkit.event.MethodEventSource MethodEventSource}, and a
  38. straightforward implementation of it is defined in
  39. {@link com.itmill.toolkit.event.EventRouter EventRouter} which also includes
  40. a method to actually fire the events.</p>
  41. <p>All fired events are passed to all registered listeners, which are of
  42. type {@link com.itmill.toolkit.event.ListenerMethod ListenerMethod}. The
  43. listener then checks if the event type matches with the specified event
  44. type and calls the specified trigger method if it does.</p>
  45. <!-- Put @see and @since tags down here. -->
  46. </body>
  47. </html>