|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.zkoss.zk.ui.metainfo.ZScriptInfo
public class ZScriptInfo
Represents a zscript element.
| Constructor Summary | |
|---|---|
ZScriptInfo(NodeInfo parent,
java.lang.String zslang,
java.lang.String content,
ConditionImpl cond)
Creates a ZScriptInfo with the content directly. |
|
ZScriptInfo(NodeInfo parent,
java.lang.String zslang,
java.lang.String url,
Locator locator,
ConditionImpl cond)
Constructs a ZScriptInfo with an URL, which might contain an EL
expression. |
|
ZScriptInfo(NodeInfo parent,
java.lang.String zslang,
java.net.URL url,
ConditionImpl cond)
Create a ZScriptInfo with an URL that is used to load the content. |
|
| Method Summary | |
|---|---|
void |
appendChild(NodeInfo child)
Append a child |
java.util.List<NodeInfo> |
getChildren()
Returns a readonly list of children. |
java.lang.String |
getContent(Page page,
Component comp)
Returns the content of zscript. |
Evaluator |
getEvaluator()
Returns the evaluator. |
EvaluatorRef |
getEvaluatorRef()
Returns the evaluator reference. |
java.lang.String |
getLanguage()
Returns the scripting language, or null if the default scripting language is preferred. |
PageDefinition |
getPageDefinition()
Returns the page definition, i.e., the root node, or null if not available. |
NodeInfo |
getParent()
Returns the parent, or null if it has no parent. |
java.lang.String |
getRawContent()
Returns the raw content. |
ZScript |
getZScript()
Returns the ZScript object hold in this info. |
boolean |
isDeferred()
Returns whether the evaluation of the zscript shall be deferred. |
boolean |
isEffective(Component comp)
Used to evaluate whether it is effective. |
boolean |
isEffective(Page page)
Used to evaluate whether it is effective. |
boolean |
removeChild(NodeInfo child)
Removes a child. |
void |
setCondition(ConditionImpl cond)
Sets the effectiveness condition. |
void |
setDeferred(boolean deferred)
Sets whether the evaluation of the zscript shall be deferred. |
void |
setLanguage(java.lang.String zslang)
Sets the scripting language. |
java.lang.String |
toString()
|
boolean |
withCondition()
Tests if the condition is set |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public ZScriptInfo(NodeInfo parent,
java.lang.String zslang,
java.lang.String content,
ConditionImpl cond)
ZScriptInfo with the content directly.
zslang - the scripting language. If null, it is the same as
Page.getZScriptLanguage().content - the zscript content
public ZScriptInfo(NodeInfo parent,
java.lang.String zslang,
java.net.URL url,
ConditionImpl cond)
ZScriptInfo with an URL that is used to load the content.
url - the URL to load the content of zscript.
public ZScriptInfo(NodeInfo parent,
java.lang.String zslang,
java.lang.String url,
Locator locator,
ConditionImpl cond)
ZScriptInfo with an URL, which might contain an EL
expression.
url - the URL. It may contain XEL expressions.locator - the locator used to locate the zscript file| Method Detail |
|---|
public ZScript getZScript()
ZScript object hold in this info.
public java.lang.String getLanguage()
public void setLanguage(java.lang.String zslang)
zslang - the scripting language. If null, the default scripting
language is assume.public java.lang.String getRawContent()
ZScriptInfo(NodeInfo, String, String, ConditionImpl).
If URL is specified in the constructor, null is returned.
On the other hand, getContent(org.zkoss.zk.ui.Page, org.zkoss.zk.ui.Component) will load the content
automatically if URL is specified.
public java.lang.String getContent(Page page,
Component comp)
Note: before evaluating the returned script, you have to invoke
isEffective(Component) or isEffective(Page) first.
page - the page when this zscript is interpreted.
Used only if this object is constructed with ZScriptInfo(NodeInfo, String, String, Locator, ConditionImpl).comp - the component when this zscript is interpreted.
Used only if this object is constructed with ZScriptInfo(NodeInfo, String, String, Locator, ConditionImpl).
UiException - if failed to load the contentpublic boolean isDeferred()
public void setDeferred(boolean deferred)
Default: false.
public java.lang.String toString()
toString in class java.lang.Objectpublic void setCondition(ConditionImpl cond)
public boolean withCondition()
public boolean isEffective(Component comp)
Condition
isEffective in interface Conditioncomp - used as the self variable. Ignored if null.public boolean isEffective(Page page)
Condition
isEffective in interface Conditionpage - used as the self variable. Ignored if null.public EvaluatorRef getEvaluatorRef()
NodeInfo
getEvaluatorRef in interface NodeInfopublic PageDefinition getPageDefinition()
NodeInfo
getPageDefinition in interface NodeInfopublic Evaluator getEvaluator()
NodeInfoAll nodes in the same ZUML tree has the same evaluator reference
(inherited from the root node, PageDefinition.getEvaluatorRef()).
getEvaluator in interface NodeInfopublic NodeInfo getParent()
NodeInfo
getParent in interface NodeInfopublic java.util.List<NodeInfo> getChildren()
NodeInfoNote: the returned list is readonly. To modify, please use
NodeInfo.appendChild(org.zkoss.zk.ui.metainfo.NodeInfo) and NodeInfo.removeChild(org.zkoss.zk.ui.metainfo.NodeInfo) instead.
getChildren in interface NodeInfopublic void appendChild(NodeInfo child)
NodeInfo
appendChild in interface NodeInfopublic boolean removeChild(NodeInfo child)
NodeInfo
removeChild in interface NodeInfo
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||