|
CS 1705 Library | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.zkoss.zk.ui.AbstractComponent
org.zkoss.zhtml.Text
cs1705.web.internal.JavaStatementElement
cs1705.web.Variable
public class Variable
A ZUL variable declaration.
A <variable> tag has two required properties and one optional property:
type - The (optional) Java type of the variable--this
should be a legal Java class name that is in scope (see
Import) (must come before the value!).name - The variable name (must come before the
value!)value - The variable's value. It can be any Java
expression, or any EL expression (i.e., ${...}), but may not be a
bound data value (no @{...}).Examples:
<variable name="x" value="new Person()"/>
<!-- With an included type -->
<variable type="Person" name="x" value="new Person()"/>
<!-- If you use quotes, they must be HTML-escaped -->
<variable name="file"
value="cs1705.IOHelper.getFile("infile.txt")"/>
<!-- A longer version, so you don't have to escape the quotes. -->
<variable name="file2">
<attribute name="value">
cs1705.IOHelper.getFile("infile.txt")
</attribute>
</variable>
| Field Summary |
|---|
| Fields inherited from interface org.zkoss.zk.ui.Component |
|---|
APPLICATION_SCOPE, COMPONENT_SCOPE, DESKTOP_SCOPE, PAGE_SCOPE, REQUEST_SCOPE, SESSION_SCOPE, SPACE_SCOPE |
| Constructor Summary | |
|---|---|
Variable()
Creates a new Variable component. |
|
| Method Summary | |
|---|---|
String |
getName()
Accessor for the "name" property. |
String |
getType()
Accessor for the "type" property, which may be null if no type has been specified. |
void |
setName(String newName)
Mutator for the "name" property. |
void |
setType(String newType)
Mutator for the "type" property, which is optional. |
void |
setValue(String newValue)
Mutator for the "value" property, which provides the variable's initial value. |
| Methods inherited from class cs1705.web.internal.JavaStatementElement |
|---|
redraw |
| Methods inherited from class org.zkoss.zhtml.Text |
|---|
getValue, invalidate, isChildable, setParent |
| Methods inherited from class java.lang.Object |
|---|
getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public Variable()
| Method Detail |
|---|
public String getName()
public void setName(String newName)
newName - The name to use for the variablepublic String getType()
Class name)public void setType(String newType)
newType - The type (class) to use for the variable. The class
name specified must either be fully qualified, or must have been
imported (see Import).public void setValue(String newValue)
setValue in class org.zkoss.zhtml.TextnewValue - The value to use for the variable. It must either
be an object of the appropriate type, or a string that can be
interpreted as a Java expression of the appropriate type.
|
Last updated: Wed, Apr 1, 2009 12:29 AM EDT | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||