Package com.saperion.ngc.util
Class EventUtil
- java.lang.Object
-
- com.saperion.ngc.util.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>
booleannotifyListeners(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>
voidnotifyListenersIfAny(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.
-
-
-
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 fromeventName
- the name of the event the listeners were registered onevent
- 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 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:
java.lang.Exception
- an exception that occured in the event listeners when handling the event
-
-