Package com.saperion.ngc.util
Class EventUtil
java.lang.Object
com.saperion.ngc.util.EventUtil
This class contains utility-methods for event-handling.
- Author:
- cmerkel
-
Method Summary
Modifier and TypeMethodDescriptionstatic <T extends org.zkoss.zk.ui.event.Event>
booleannotifyListeners
(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>
voidnotifyListenersIfAny
(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.
-
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 fromeventName
- the name of the event the listeners were registered onevent
- 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 fromeventName
- the name of the event the listeners were registered onevent
- 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
-