org.zkoss.zk.ui.metainfo
Class WidgetListener

java.lang.Object
  extended by org.zkoss.zk.ui.metainfo.WidgetListener
All Implemented Interfaces:
java.io.Serializable, Condition
Direct Known Subclasses:
WidgetOverride

public class WidgetListener
extends java.lang.Object
implements Condition, java.io.Serializable

Represents a client-side event listener for the peer widget. Notice that, unlike WidgetOverride, getScript() has only the function's body (without function (event)).

Since:
5.0.0
Author:
tomyeh
See Also:
EventHandler, WidgetOverride, Serialized Form

Field Summary
protected  ConditionImpl _cond
           
protected  java.lang.String _name
           
protected  java.lang.String _script
           
 
Constructor Summary
WidgetListener(EvaluatorRef evalr, java.lang.String name, java.lang.String script, ConditionImpl cond)
           
 
Method Summary
 void assign(Component comp)
           
 java.lang.String getName()
          Returns the event name, such as, onClick.
 java.lang.String getScript()
          Returns the script associated with this event handler.
 boolean isEffective(Component comp)
          Used to evaluate whether it is effective.
 boolean isEffective(Page page)
          Used to evaluate whether it is effective.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

_name

protected final java.lang.String _name

_script

protected final java.lang.String _script

_cond

protected final ConditionImpl _cond
Constructor Detail

WidgetListener

public WidgetListener(EvaluatorRef evalr,
                      java.lang.String name,
                      java.lang.String script,
                      ConditionImpl cond)
Parameters:
name - the event name, such as onClick
evalr - the evaluator reference. It is required if cond is not null.
Throws:
java.lang.IllegalArgumentException - if script is null or (cond is not null but evalr is null)
Method Detail

getName

public java.lang.String getName()
Returns the event name, such as, onClick.


getScript

public java.lang.String getScript()
Returns the script associated with this event handler.


assign

public void assign(Component comp)

isEffective

public boolean isEffective(Component comp)
Description copied from interface: Condition
Used to evaluate whether it is effective.

Specified by:
isEffective in interface Condition
Parameters:
comp - used as the self variable. Ignored if null.

isEffective

public boolean isEffective(Page page)
Description copied from interface: Condition
Used to evaluate whether it is effective.

Specified by:
isEffective in interface Condition
Parameters:
page - used as the self variable. Ignored if null.


Copyright © 2005-2009 Potix Corporation. All Rights Reserved. SourceForge.net Logo