Class EventUtil

java.lang.Object
com.saperion.ngc.util.EventUtil

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

    Modifier and Type
    Method
    Description
    static <T extends org.zkoss.zk.ui.event.Event>
    boolean
    notifyListeners(org.zkoss.zk.ui.Component component, 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, 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 Details

    • notifyListenersIfAny

      public static <T extends org.zkoss.zk.ui.event.Event> void notifyListenersIfAny(org.zkoss.zk.ui.Component component, String eventName, T event) throws 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:
      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, String eventName, T event) throws 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:
      Exception - an exception that occured in the event listeners when handling the event