Package com.znize.platform.model.view
Class TreeView
- java.lang.Object
-
- com.znize.platform.model.view.Widget
-
- com.znize.platform.model.view.TreeView
-
- All Implemented Interfaces:
java.io.Serializable
public class TreeView extends Widget implements java.io.Serializable
TreeView: Tree options for rendering content as tree.- Since:
- 4.0
- See Also:
- Serialized Form
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.IntegergetExpandedDepth()Get the initial expanded depth of tree nodes.booleanisAnimate()Whether to enable expand/collapse effect?booleanisCache()Whether to cache nodes on client?booleanisDynamic()whether to load tree nodes on demand?protected voidparseElement(org.w3c.dom.Element childElem)Parse the child element.voidsetAnimate(boolean animate)Set whether to enable expand/collapse effectvoidsetCache(boolean cache)Set whether to cache nodes on clientvoidsetDynamic(boolean dynamic)Set whether to load tree nodes on demandvoidsetExpandedDepth(java.lang.Integer expandedDepth)Set the initial expanded depth of tree nodes.
-
-
-
Constructor Detail
-
TreeView
public TreeView()
Default constructor. Not dynamic, caching nodes on client and animated.
-
TreeView
protected TreeView(boolean dynamic, boolean cache, boolean animate)Constructor- Parameters:
dynamic- true if loading tree nodes on demandcache- true if caching nodes on clientanimate- true if enabling expand/collapse effect
-
TreeView
public TreeView(org.w3c.dom.Element treeViewElem) throws ParseExceptionConstructor with XML element.<treeView> <dynamic>false</dynamic> <cache>true</cache> <animate>true</animate> <expandedDepth>3</expandedDepth> </treeView>- Parameters:
treeViewElem- treeView root element- Throws:
ParseException- throw if a parsing error occurs
-
-
Method Detail
-
parseElement
protected void parseElement(org.w3c.dom.Element childElem) throws ParseExceptionDescription copied from class:WidgetParse the child element.- Overrides:
parseElementin classWidget- Parameters:
childElem- a child element of widget element- Throws:
ParseException- throw if a parsing error occurs
-
isDynamic
public boolean isDynamic()
whether to load tree nodes on demand?- Returns:
- true if loading tree nodes on demand
-
setDynamic
public void setDynamic(boolean dynamic)
Set whether to load tree nodes on demand- Parameters:
dynamic- true if loading tree nodes on demand
-
isCache
public boolean isCache()
Whether to cache nodes on client?- Returns:
- true if caching nodes on client
-
setCache
public void setCache(boolean cache)
Set whether to cache nodes on client- Parameters:
cache- true if caching nodes on client
-
isAnimate
public boolean isAnimate()
Whether to enable expand/collapse effect?- Returns:
- true if expand/collapse effect is enabled
-
setAnimate
public void setAnimate(boolean animate)
Set whether to enable expand/collapse effect- Parameters:
animate- true if enabling expand/collapse effect
-
getExpandedDepth
public java.lang.Integer getExpandedDepth()
Get the initial expanded depth of tree nodes. A menu node whose depth is less than or equals to the depth will be expanded initially. The depth of root is 1.- Returns:
- initial expanded depth
-
setExpandedDepth
public void setExpandedDepth(java.lang.Integer expandedDepth)
Set the initial expanded depth of tree nodes. A menu node whose depth is less than or equals to the depth will be expanded initially. The depth of root is 1.- Parameters:
expandedDepth- initial expanded depth
-
-