Class LazyTreeNode<T>

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

    public class LazyTreeNode<T>
    extends Object
    implements org.primefaces.model.TreeNode<T>, Serializable
    A tree node for a lazy loading PrimeFaces trees. Specify an adapter that implements the loading process.
    Author:
    XIMA MEDIA GmbH
    See Also:
    Serialized Form
    • Constructor Detail

      • LazyTreeNode

        public LazyTreeNode​(ILazyTreeNodeAdapter<T> adapter,
                            String type,
                            T data,
                            String rowKey)
        Creates a new node without a parent, should be used for root nodes.
        Parameters:
        adapter - Adapter to use for lazy loading.
        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.
        rowKey - Key for this node.
      • LazyTreeNode

        public LazyTreeNode​(ILazyTreeNodeAdapter<T> adapter,
                            String type,
                            T data,
                            String rowKey,
                            org.primefaces.model.TreeNode<T> parent)
        Creates a new node with a parent.
        Parameters:
        adapter - Adapter to use for lazy loading.
        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

      • clearParent

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

        public int getChildCount()
        Specified by:
        getChildCount 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>
      • getData

        public T getData()
        Specified by:
        getData 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>
      • getRowKey

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

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

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

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

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

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

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

        public void setExpanded​(boolean expanded)
        Specified by:
        setExpanded 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>
      • setPartialSelected

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

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

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

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

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