Class AbstractLazyLoadingTreeNode<T extends javax.swing.tree.TreeNode>

  • All Implemented Interfaces:
    javax.swing.tree.TreeNode

    public abstract class AbstractLazyLoadingTreeNode<T extends javax.swing.tree.TreeNode>
    extends java.lang.Object
    implements javax.swing.tree.TreeNode
    Tree Node implementation which only populates its children upon demand.
    • Field Summary

      Fields 
      Modifier and Type Field Description
      protected javax.swing.tree.TreeNode parent  
    • Constructor Summary

      Constructors 
      Modifier Constructor Description
      protected AbstractLazyLoadingTreeNode​(javax.swing.tree.TreeNode parent)  
    • Field Detail

      • parent

        protected javax.swing.tree.TreeNode parent
    • Constructor Detail

      • AbstractLazyLoadingTreeNode

        protected AbstractLazyLoadingTreeNode​(javax.swing.tree.TreeNode parent)
    • Method Detail

      • checkChildren

        protected void checkChildren()
      • setChildren

        protected void setChildren​(java.util.List<T> children)
      • loadChildren

        @Nullable
        protected abstract java.util.List<T> loadChildren()
        This will be called as late a possible for the node to populate its children list. May return null if there are no children.
      • findChild

        public java.util.Optional<T> findChild​(java.util.function.Predicate<T> predicate)
      • getChildAt

        public javax.swing.tree.TreeNode getChildAt​(int index)
        Specified by:
        getChildAt in interface javax.swing.tree.TreeNode
      • getChildCount

        public int getChildCount()
        Specified by:
        getChildCount in interface javax.swing.tree.TreeNode
      • getParent

        public javax.swing.tree.TreeNode getParent()
        Specified by:
        getParent in interface javax.swing.tree.TreeNode
      • getIndex

        public int getIndex​(javax.swing.tree.TreeNode node)
        Specified by:
        getIndex in interface javax.swing.tree.TreeNode
      • getAllowsChildren

        public boolean getAllowsChildren()
        Specified by:
        getAllowsChildren in interface javax.swing.tree.TreeNode
      • isLeaf

        public boolean isLeaf()
        Specified by:
        isLeaf in interface javax.swing.tree.TreeNode
      • children

        public java.util.Enumeration children()
        Specified by:
        children in interface javax.swing.tree.TreeNode