Class BasicTreeNode<T>

  • Type Parameters:
    T - Type of the tree data.
    All Implemented Interfaces:
    org.primefaces.model.TreeNode<T>

    public class BasicTreeNode<T>
    extends Object
    implements org.primefaces.model.TreeNode<T>
    A basic tree node.
    Since:
    8.2.0
    Author:
    XIMA MEDIA GmbH
    • Constructor Detail

      • BasicTreeNode

        public BasicTreeNode()
        Creates a new basic root node.
      • BasicTreeNode

        public BasicTreeNode​(String type,
                             T data,
                             String rowKey,
                             org.primefaces.model.TreeNode<T> parent)
        Creates a new node with a parent.
        Parameters:
        type - Type of the tree node, can be used later to show a different UI depending on the type.
        data - User-defined data for the node.
        parent - Parent of this node.
        rowKey - Key for this node.
    • Method Detail

      • getChildCount

        public int getChildCount()
        Specified by:
        getChildCount in interface org.primefaces.model.TreeNode<T>
      • getParent

        public org.primefaces.model.TreeNode<T> getParent()
        Specified by:
        getParent in interface org.primefaces.model.TreeNode<T>
      • setParent

        public void setParent​(org.primefaces.model.TreeNode<T> treeNode)
        Specified by:
        setParent in interface org.primefaces.model.TreeNode<T>
      • getData

        public T getData()
        Specified by:
        getData in interface org.primefaces.model.TreeNode<T>
      • getChildren

        public List<org.primefaces.model.TreeNode<T>> getChildren()
        Specified by:
        getChildren in interface org.primefaces.model.TreeNode<T>
      • getRowKey

        public String getRowKey()
        Specified by:
        getRowKey in interface org.primefaces.model.TreeNode<T>
      • setRowKey

        public void setRowKey​(String rowKey)
        Specified by:
        setRowKey in interface org.primefaces.model.TreeNode<T>
      • isLeaf

        public boolean isLeaf()
        Specified by:
        isLeaf in interface org.primefaces.model.TreeNode<T>
      • isExpanded

        public boolean isExpanded()
        Specified by:
        isExpanded in interface org.primefaces.model.TreeNode<T>
      • setExpanded

        public void setExpanded​(boolean expanded)
        Specified by:
        setExpanded in interface org.primefaces.model.TreeNode<T>
      • isSelected

        public boolean isSelected()
        Specified by:
        isSelected in interface org.primefaces.model.TreeNode<T>
      • setSelected

        public void setSelected​(boolean selected)
        Specified by:
        setSelected in interface org.primefaces.model.TreeNode<T>
      • isSelectable

        public boolean isSelectable()
        Specified by:
        isSelectable in interface org.primefaces.model.TreeNode<T>
      • setSelectable

        public void setSelectable​(boolean selectable)
        Specified by:
        setSelectable in interface org.primefaces.model.TreeNode<T>
      • isPartialSelected

        public boolean isPartialSelected()
        Specified by:
        isPartialSelected in interface org.primefaces.model.TreeNode<T>
      • setPartialSelected

        public void setPartialSelected​(boolean value)
        Specified by:
        setPartialSelected in interface org.primefaces.model.TreeNode<T>
      • getType

        public String getType()
        Specified by:
        getType in interface org.primefaces.model.TreeNode<T>
      • setType

        public void setType​(String type)
        Specified by:
        setType in interface org.primefaces.model.TreeNode<T>
      • clearParent

        public void clearParent()
        Specified by:
        clearParent in interface org.primefaces.model.TreeNode<T>
      • addChild

        public boolean addChild​(org.primefaces.model.TreeNode<T> child)