public final class AsyncTreeModel extends AbstractTreeModel implements Identifiable, Searchable, Navigatable, TreeVisitor.Acceptor
Disposable.Parent
disposed, listeners
Constructor and Description |
---|
AsyncTreeModel(javax.swing.tree.TreeModel model)
Deprecated.
use
AsyncTreeModel(TreeModel, Disposable) instead |
AsyncTreeModel(javax.swing.tree.TreeModel model,
boolean showLoadingNode)
Deprecated.
use
AsyncTreeModel(TreeModel, boolean, Disposable) instead |
AsyncTreeModel(javax.swing.tree.TreeModel model,
boolean showLoadingNode,
Disposable parent) |
AsyncTreeModel(javax.swing.tree.TreeModel model,
Disposable parent) |
Modifier and Type | Method and Description |
---|---|
Promise<javax.swing.tree.TreePath> |
accept(TreeVisitor visitor)
Starts visiting the tree structure with loading all needed children.
|
Promise<javax.swing.tree.TreePath> |
accept(TreeVisitor visitor,
boolean allowLoading)
Starts visiting the tree structure.
|
void |
dispose()
Usually not invoked directly, see class javadoc.
|
java.lang.Object |
getChild(java.lang.Object object,
int index) |
int |
getChildCount(java.lang.Object object) |
int |
getIndexOfChild(java.lang.Object object,
java.lang.Object child) |
java.lang.Object |
getRoot() |
Promise<javax.swing.tree.TreePath> |
getTreePath(java.lang.Object object)
Starts searching by the specified object.
|
java.lang.Object |
getUniqueID(javax.swing.tree.TreePath path)
Returns an unique identifier for the specified path if applicable.
|
boolean |
isLeaf(java.lang.Object object) |
boolean |
isProcessing() |
Promise<javax.swing.tree.TreePath> |
nextTreePath(javax.swing.tree.TreePath path,
java.lang.Object object) |
void |
onValidThread(java.lang.Runnable runnable) |
Promise<javax.swing.tree.TreePath> |
prevTreePath(javax.swing.tree.TreePath path,
java.lang.Object object) |
Promise<javax.swing.tree.TreePath> |
resolve(javax.swing.tree.TreePath path) |
void |
setRootImmediately(java.lang.Object object)
Deprecated.
do not use
|
protected void |
treeNodesChanged(javax.swing.tree.TreePath path,
int[] indices,
java.lang.Object[] children)
Notifies all added listeners that some nodes were changed.
|
protected void |
treeNodesInserted(javax.swing.tree.TreePath path,
int[] indices,
java.lang.Object[] children)
Notifies all added listeners that some nodes were inserted.
|
protected void |
treeNodesRemoved(javax.swing.tree.TreePath path,
int[] indices,
java.lang.Object[] children)
/**
Notifies all added listeners that some nodes were removed.
|
protected void |
treeStructureChanged(javax.swing.tree.TreePath path,
int[] indices,
java.lang.Object[] children)
Notifies all added listeners that a tree hierarchy was changed.
|
void |
valueForPathChanged(javax.swing.tree.TreePath path,
java.lang.Object value) |
addTreeModelListener, removeTreeModelListener
@Deprecated public AsyncTreeModel(javax.swing.tree.TreeModel model)
AsyncTreeModel(TreeModel, Disposable)
instead@Deprecated public AsyncTreeModel(javax.swing.tree.TreeModel model, boolean showLoadingNode)
AsyncTreeModel(TreeModel, boolean, Disposable)
insteadpublic AsyncTreeModel(javax.swing.tree.TreeModel model, Disposable parent)
public AsyncTreeModel(javax.swing.tree.TreeModel model, boolean showLoadingNode, Disposable parent)
public void dispose()
Disposable
dispose
in interface Disposable
dispose
in class AbstractTreeModel
public java.lang.Object getUniqueID(javax.swing.tree.TreePath path)
Identifiable
getUniqueID
in interface Identifiable
path
- a tree path in the current tree modelnull
if not applicableSearchable.getTreePath(java.lang.Object)
public Promise<javax.swing.tree.TreePath> getTreePath(java.lang.Object object)
Searchable
getTreePath
in interface Searchable
object
- an object to identify a tree pathPromise
containing a search resultIdentifiable.getUniqueID(javax.swing.tree.TreePath)
public Promise<javax.swing.tree.TreePath> nextTreePath(javax.swing.tree.TreePath path, java.lang.Object object)
nextTreePath
in interface Navigatable
public Promise<javax.swing.tree.TreePath> prevTreePath(javax.swing.tree.TreePath path, java.lang.Object object)
prevTreePath
in interface Navigatable
public Promise<javax.swing.tree.TreePath> resolve(javax.swing.tree.TreePath path)
public java.lang.Object getRoot()
getRoot
in interface javax.swing.tree.TreeModel
public java.lang.Object getChild(java.lang.Object object, int index)
getChild
in interface javax.swing.tree.TreeModel
public int getChildCount(java.lang.Object object)
getChildCount
in interface javax.swing.tree.TreeModel
public boolean isLeaf(java.lang.Object object)
isLeaf
in interface javax.swing.tree.TreeModel
public void valueForPathChanged(javax.swing.tree.TreePath path, java.lang.Object value)
valueForPathChanged
in interface javax.swing.tree.TreeModel
valueForPathChanged
in class AbstractTreeModel
path
- the path to the node that the user has alteredvalue
- the new value from the tree cell editorDefaultTreeModel.valueForPathChanged(javax.swing.tree.TreePath, java.lang.Object)
public int getIndexOfChild(java.lang.Object object, java.lang.Object child)
getIndexOfChild
in interface javax.swing.tree.TreeModel
public Promise<javax.swing.tree.TreePath> accept(TreeVisitor visitor)
accept
in interface TreeVisitor.Acceptor
visitor
- an object that controls visiting a tree structurepublic Promise<javax.swing.tree.TreePath> accept(TreeVisitor visitor, boolean allowLoading)
visitor
- an object that controls visiting a tree structureallowLoading
- load all needed children if true
public boolean isProcessing()
true
if this model is updating its structurepublic void onValidThread(java.lang.Runnable runnable)
protected void treeStructureChanged(javax.swing.tree.TreePath path, int[] indices, java.lang.Object[] children)
AbstractTreeModel
treeStructureChanged
in class AbstractTreeModel
path
- the path to the parent of the modified itemsindices
- index values of the modified itemschildren
- an array containing the inserted, removed, or changed objectsTreeModelListener.treeStructureChanged(TreeModelEvent)
protected void treeNodesChanged(javax.swing.tree.TreePath path, int[] indices, java.lang.Object[] children)
AbstractTreeModel
treeNodesChanged
in class AbstractTreeModel
path
- the path to the parent of the modified itemsindices
- index values of the modified itemschildren
- an array containing the inserted, removed, or changed objectsTreeModelListener.treeNodesChanged(TreeModelEvent)
protected void treeNodesInserted(javax.swing.tree.TreePath path, int[] indices, java.lang.Object[] children)
AbstractTreeModel
treeNodesInserted
in class AbstractTreeModel
path
- the path to the parent of the modified itemsindices
- index values of the modified itemschildren
- an array containing the inserted, removed, or changed objectsTreeModelListener.treeNodesInserted(TreeModelEvent)
protected void treeNodesRemoved(javax.swing.tree.TreePath path, int[] indices, java.lang.Object[] children)
AbstractTreeModel
treeNodesRemoved
in class AbstractTreeModel
path
- the path to the parent of the modified itemsindices
- index values of the modified itemschildren
- an array containing the inserted, removed, or changed objectsTreeModelListener.treeNodesRemoved(TreeModelEvent)
@Deprecated public void setRootImmediately(java.lang.Object object)