Package org.zkoss.zk.ui.metainfo
Class EventHandlerMap
java.lang.Object
org.zkoss.zk.ui.metainfo.EventHandlerMap
- All Implemented Interfaces:
Serializable,Cloneable
A map of instances of
EventHandler.
Note: it is not thread safe. Thus, it is better to clone()
and then modifying the cloned instance if you want to change it
concurrently.
- Author:
- tomyeh
- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidadd(String evtnm, EventHandler evthd) Adds the event handler for the specified event name.voidaddAll(EventHandlerMap src) Adds all event handlers of the specified map to this map.clone()Clones this event handler map.Returns the first effective event handler of the specified event name, or null if not available.Returns a readonly list of all event handlers associated with the specified event name, or null if no handler is associated with.Returns a readonly collection of event names (String), or an empty collection if no event name is registered.booleanisEmpty()Returns whether no event handler at all.toString()
-
Constructor Details
-
EventHandlerMap
public EventHandlerMap()
-
-
Method Details
-
isEmpty
public boolean isEmpty()Returns whether no event handler at all. -
get
Returns the first effective event handler of the specified event name, or null if not available.It checks whether an event handler is effective by calling
Condition.isEffective(Component).- Parameters:
comp- the component used to evaluate whether an event handler is effective.- Since:
- 3.0.0
- See Also:
-
getEventNames
Returns a readonly collection of event names (String), or an empty collection if no event name is registered.- Since:
- 3.0.2
-
getAll
Returns a readonly list of all event handlers associated with the specified event name, or null if no handler is associated with.Unlike
get(Component,String), it returns all event handlers no matter whether they are effective.- Since:
- 3.0.0
-
add
Adds the event handler for the specified event name.Note: the new handler won't overwrite the previous one, unless
ConditionValue.getCondition()is the same. Rather, the new handler is appended to the list. You can retreive list by invokinggetAll(java.lang.String).- Since:
- 3.0.0
- See Also:
-
addAll
Adds all event handlers of the specified map to this map. -
clone
Clones this event handler map. -
toString
-