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)  
    • Method Summary

      All Methods Instance Methods Abstract Methods Concrete Methods 
      Modifier and Type Method Description
      protected void checkChildren()  
      java.util.Enumeration<? extends javax.swing.tree.TreeNode> children()  
      java.util.Optional<T> findChild​(java.util.function.Predicate<T> predicate)  
      boolean getAllowsChildren()  
      javax.swing.tree.TreeNode getChildAt​(int index)  
      int getChildCount()  
      int getIndex​(javax.swing.tree.TreeNode node)  
      javax.swing.tree.TreeNode getParent()  
      boolean isLeaf()  
      protected abstract java.util.List<T> loadChildren()
      This will be called as late a possible for the node to populate its children list.
      protected void setChildren​(java.util.List<T> children)  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • 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<? extends javax.swing.tree.TreeNode> children()
        Specified by:
        children in interface javax.swing.tree.TreeNode