public abstract class AbstractAsynchronousTreeNode<T extends javax.swing.tree.TreeNode> extends java.lang.Object implements AsynchronousTreeNode
| Modifier and Type | Class and Description |
|---|---|
protected static class |
AbstractAsynchronousTreeNode.LoadingStatus |
| Modifier and Type | Field and Description |
|---|---|
protected T |
errorNode |
protected T |
loadingNode |
protected java.util.List<T> |
nodeList |
protected T |
parent |
protected javax.swing.tree.DefaultTreeModel |
treeModel |
| Constructor and Description |
|---|
AbstractAsynchronousTreeNode(javax.swing.tree.DefaultTreeModel treeModel,
T parent) |
| Modifier and Type | Method and Description |
|---|---|
void |
blockLoad()
If the children haven't already been loaded, then loads the children of this node synchronously within this call.
|
protected void |
checkChildren(boolean force) |
java.util.Enumeration |
children() |
boolean |
getAllowsChildren() |
T |
getChildAt(int idx) |
int |
getChildCount() |
int |
getIndex(javax.swing.tree.TreeNode node) |
T |
getParent() |
boolean |
isLeaf() |
protected abstract java.util.List<T> |
loadChildren() |
protected void |
loadDone(java.util.List<T> nodeList) |
protected void |
loadError(java.lang.Exception ex) |
protected abstract T |
newErrorNode(java.lang.Throwable ex) |
protected abstract T |
newLoadingNode() |
void |
reload() |
protected void |
showLoadingError(java.lang.Exception ex)
Optional override to display a loading error
|
void |
sortChildren(java.util.Comparator<T> comparator) |
protected javax.swing.tree.DefaultTreeModel treeModel
protected T extends javax.swing.tree.TreeNode loadingNode
protected T extends javax.swing.tree.TreeNode errorNode
protected java.util.List<T extends javax.swing.tree.TreeNode> nodeList
protected T extends javax.swing.tree.TreeNode parent
public AbstractAsynchronousTreeNode(javax.swing.tree.DefaultTreeModel treeModel,
T parent)
protected abstract T newLoadingNode()
protected abstract T newErrorNode(java.lang.Throwable ex)
protected abstract java.util.List<T> loadChildren() throws java.lang.Exception
java.lang.Exceptionprotected void loadDone(java.util.List<T> nodeList)
protected void loadError(java.lang.Exception ex)
protected void showLoadingError(java.lang.Exception ex)
protected void checkChildren(boolean force)
public void blockLoad()
blockLoad in interface AsynchronousTreeNodepublic T getChildAt(int idx)
getChildAt in interface javax.swing.tree.TreeNodepublic T getParent()
getParent in interface javax.swing.tree.TreeNodepublic void reload()
public java.util.Enumeration children()
children in interface javax.swing.tree.TreeNodepublic void sortChildren(java.util.Comparator<T> comparator)
public boolean getAllowsChildren()
getAllowsChildren in interface javax.swing.tree.TreeNodepublic int getChildCount()
getChildCount in interface javax.swing.tree.TreeNodepublic int getIndex(javax.swing.tree.TreeNode node)
getIndex in interface javax.swing.tree.TreeNodepublic boolean isLeaf()
isLeaf in interface javax.swing.tree.TreeNode