|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.zkoss.zk.ui.metainfo.EventHandlerMap
public class EventHandlerMap
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.
Constructor Summary | |
---|---|
EventHandlerMap()
|
Method Summary | |
---|---|
void |
add(java.lang.String evtnm,
EventHandler evthd)
Adds the event handler for the specified event name. |
void |
addAll(EventHandlerMap src)
Adds all event handlers of the specified map to this map. |
java.lang.Object |
clone()
Clones this event handler map. |
EventHandler |
get(Component comp,
java.lang.String evtnm)
Returns the first effective event handler of the specified event name, or null if not available. |
java.util.List<EventHandler> |
getAll(java.lang.String evtnm)
Returns a readonly list of all event handlers associated with the specified event name, or null if no handler is associated with. |
java.util.Set<java.lang.String> |
getEventNames()
Returns a readonly collection of event names (String), or an empty collection if no event name is registered. |
boolean |
isEmpty()
Returns whether no event handler at all. |
java.lang.String |
toString()
|
Methods inherited from class java.lang.Object |
---|
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public EventHandlerMap()
Method Detail |
---|
public boolean isEmpty()
public EventHandler get(Component comp, java.lang.String evtnm)
It checks whether an event handler is effective by calling
ConditionValue.isEffective(Component)
.
comp
- the component used to evaluate whether an event handler
is effective.ConditionValue.isEffective(Component)
public java.util.Set<java.lang.String> getEventNames()
public java.util.List<EventHandler> getAll(java.lang.String evtnm)
Unlike get(Component,String)
, it returns all
event handlers no matter whether they are effective.
public void add(java.lang.String evtnm, EventHandler evthd)
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 invoking getAll(java.lang.String)
.
getAll(java.lang.String)
public void addAll(EventHandlerMap src)
public java.lang.Object clone()
clone
in class java.lang.Object
public java.lang.String toString()
toString
in class java.lang.Object
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |