Class EventUtil


  • public final class EventUtil
    extends java.lang.Object
    This class contains utility-methods for event-handling.
    Author:
    cmerkel
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static <T extends org.zkoss.zk.ui.event.Event>
      boolean
      notifyListeners​(org.zkoss.zk.ui.Component component, java.lang.String eventName, T event)
      Notifies all listeners for the specified event-name on the specified component about the event.
      static <T extends org.zkoss.zk.ui.event.Event>
      void
      notifyListenersIfAny​(org.zkoss.zk.ui.Component component, java.lang.String eventName, T event)
      Notifies all listeners for the specified event-name on the specified component about the event.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Method Detail

      • notifyListenersIfAny

        public static <T extends org.zkoss.zk.ui.event.Event> void notifyListenersIfAny​(org.zkoss.zk.ui.Component component,
                                                                                        java.lang.String eventName,
                                                                                        T event)
                                                                                 throws java.lang.Exception
        Notifies all listeners for the specified event-name on the specified component about the event. If there are no listeners for the specified event this method does nothing.
        Type Parameters:
        T - the type of the event
        Parameters:
        component - the component to get the event listeners from
        eventName - the name of the event the listeners were registered on
        event - the event to send to the listeners
        Throws:
        java.lang.Exception - an exception that occured in the event listeners when handling the event
      • notifyListeners

        public static <T extends org.zkoss.zk.ui.event.Event> boolean notifyListeners​(org.zkoss.zk.ui.Component component,
                                                                                      java.lang.String eventName,
                                                                                      T event)
                                                                               throws java.lang.Exception
        Notifies all listeners for the specified event-name on the specified component about the event. If there are no listeners for the specified event this method returns false.
        Type Parameters:
        T - the type of the event
        Parameters:
        component - the component to get the event listeners from
        eventName - the name of the event the listeners were registered on
        event - the event to send to the listeners
        Returns:
        true if the event was handled by at least one listener, otherwise false
        Throws:
        java.lang.Exception - an exception that occured in the event listeners when handling the event