Class AbstractLazyLoadingTreeNode<T extends javax.swing.tree.TreeNode>
- java.lang.Object
-
- com.inductiveautomation.ignition.client.util.gui.tree.AbstractLazyLoadingTreeNode<T>
-
- 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)
-
-
-
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.
-
getChildAt
public javax.swing.tree.TreeNode getChildAt(int index)
- Specified by:
getChildAt
in interfacejavax.swing.tree.TreeNode
-
getChildCount
public int getChildCount()
- Specified by:
getChildCount
in interfacejavax.swing.tree.TreeNode
-
getParent
public javax.swing.tree.TreeNode getParent()
- Specified by:
getParent
in interfacejavax.swing.tree.TreeNode
-
getIndex
public int getIndex(javax.swing.tree.TreeNode node)
- Specified by:
getIndex
in interfacejavax.swing.tree.TreeNode
-
getAllowsChildren
public boolean getAllowsChildren()
- Specified by:
getAllowsChildren
in interfacejavax.swing.tree.TreeNode
-
isLeaf
public boolean isLeaf()
- Specified by:
isLeaf
in interfacejavax.swing.tree.TreeNode
-
children
public java.util.Enumeration<? extends javax.swing.tree.TreeNode> children()
- Specified by:
children
in interfacejavax.swing.tree.TreeNode
-
-