Class 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
    • Constructor Summary

      Constructors 
      Modifier Constructor Description
        TreeView()
      Default constructor.
      protected TreeView​(boolean dynamic, boolean cache, boolean animate)
      Constructor
        TreeView​(org.w3c.dom.Element treeViewElem)
      Constructor with XML element.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      java.lang.Integer getExpandedDepth()
      Get the initial expanded depth of tree nodes.
      boolean isAnimate()
      Whether to enable expand/collapse effect?
      boolean isCache()
      Whether to cache nodes on client?
      boolean isDynamic()
      whether to load tree nodes on demand?
      protected void parseElement​(org.w3c.dom.Element childElem)
      Parse the child element.
      void setAnimate​(boolean animate)
      Set whether to enable expand/collapse effect
      void setCache​(boolean cache)
      Set whether to cache nodes on client
      void setDynamic​(boolean dynamic)
      Set whether to load tree nodes on demand
      void setExpandedDepth​(java.lang.Integer expandedDepth)
      Set the initial expanded depth of tree nodes.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • 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 demand
        cache - true if caching nodes on client
        animate - true if enabling expand/collapse effect
      • TreeView

        public TreeView​(org.w3c.dom.Element treeViewElem)
                 throws ParseException
        Constructor 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 ParseException
        Description copied from class: Widget
        Parse the child element.
        Overrides:
        parseElement in class Widget
        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