org.zkoss.zk.ui.util
Class ConditionImpl

java.lang.Object
  extended by org.zkoss.zk.ui.util.ConditionImpl
All Implemented Interfaces:
java.io.Serializable

public class ConditionImpl
extends java.lang.Object
implements java.io.Serializable

An utility to simplify the implementation of Condition. Note: it doesn't implement Condition.

Author:
tomyeh
See Also:
Serialized Form

Constructor Summary
ConditionImpl(java.lang.String ifc, java.lang.String unless)
          Construct.
 
Method Summary
static ConditionImpl getInstance(java.lang.String ifc, java.lang.String unless)
          Returns an instance of Condition, or null if both ifc and unless are empty.
 boolean isEffective(Evaluator eval, Component comp)
          Used to evaluate whether it is effective.
 boolean isEffective(Evaluator eval, Page page)
          Used to evaluate whether it is effective.
 void setIf(java.lang.String cond)
          Sets the if condition.
 void setUnless(java.lang.String cond)
          Sets the unless condition.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ConditionImpl

public ConditionImpl(java.lang.String ifc,
                     java.lang.String unless)
Construct. In most cases, use getInstance(java.lang.String, java.lang.String) instead of this constructor.

Method Detail

getInstance

public static ConditionImpl getInstance(java.lang.String ifc,
                                        java.lang.String unless)
Returns an instance of Condition, or null if both ifc and unless are empty. In other words, it is useful if you use null or empty to denote true.


setIf

public void setIf(java.lang.String cond)
Sets the if condition.

Parameters:
cond - the condition. Note: If null (not specified), it is considered effective.
See Also:
isEffective(org.zkoss.zk.xel.Evaluator, org.zkoss.zk.ui.Component)

setUnless

public void setUnless(java.lang.String cond)
Sets the unless condition.

Parameters:
cond - the condition. Note: If null (not specified), it is considered ineffective.
See Also:
isEffective(org.zkoss.zk.xel.Evaluator, org.zkoss.zk.ui.Component)

isEffective

public boolean isEffective(Evaluator eval,
                           Component comp)
Used to evaluate whether it is effective.

Parameters:
eval - the evaluator to evaluate this condition
comp - used as the self variable. Ignored if null.
Since:
3.0.0

isEffective

public boolean isEffective(Evaluator eval,
                           Page page)
Used to evaluate whether it is effective.

Parameters:
eval - the evaluator to evaluate this condition
page - used as the self variable. Ignored if null.
Since:
3.0.0


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