public abstract class ProjectCustomTreeModel extends ProjectTreeModel
| Modifier | Constructor and Description |
|---|---|
protected |
ProjectCustomTreeModel(VPTNode root) |
| Modifier and Type | Method and Description |
|---|---|
protected void |
addChild(VPTProject proj,
VPTNode child)
Adds a child to the list of children of the given project.
|
protected javax.swing.tree.TreeNode[] |
buildPathToRoot(javax.swing.tree.TreeNode aNode,
javax.swing.tree.TreeNode... children)
Returns the path from the root to the given node, appending
an optional list of children of the node to the path.
|
protected java.util.Map<VPTProject,java.util.List<VPTNode>> |
getCache()
Returns the internally cached children lists.
|
protected java.util.List<VPTNode> |
getCachedChildren(VPTProject proj)
Retrieves the list of child nodes from the given project,
first trying the cache.
|
java.lang.Object |
getChild(java.lang.Object parent,
int index)
Returns the child at the given index of the given parent.
|
int |
getChildCount(java.lang.Object parent)
Returns the number of children of the given node, based on the
internal cached data.
|
protected abstract java.util.List<VPTNode> |
getChildren(VPTProject proj)
Subclasses should implement this method to populate the list
of children of a project node.
|
int |
getIndexOfChild(java.lang.Object parent,
java.lang.Object child)
Returns the index of the given child in the given parent,
according to the information in the internal cache.
|
javax.swing.tree.TreeNode[] |
getPathToRoot(javax.swing.tree.TreeNode aNode)
Builds the path to the root of the tree up to the given
node.
|
protected boolean |
isCustom()
Overrides the parent implementation, returning "true".
|
void |
nodeChanged(javax.swing.tree.TreeNode node)
Handles a node changed request.
|
void |
nodeStructureChanged(javax.swing.tree.TreeNode node)
Called when some node in the tree is changed.
|
void |
projectClosed(VPTProject p)
Remove data related to the project from the cache.
|
protected void |
removeChild(VPTProject proj,
VPTNode child)
Remove a child from the internal cache for the given project.
|
fileClosed, fileOpened, getNameaddTreeModelListener, asksAllowsChildren, fireTreeNodesChanged, fireTreeNodesInserted, fireTreeNodesRemoved, fireTreeStructureChanged, getListeners, getPathToRoot, getRoot, getTreeModelListeners, insertNodeInto, isLeaf, nodesChanged, nodesWereInserted, nodesWereRemoved, reload, reload, removeNodeFromParent, removeTreeModelListener, setAsksAllowsChildren, setRoot, valueForPathChangedprotected ProjectCustomTreeModel(VPTNode root)
public java.lang.Object getChild(java.lang.Object parent,
int index)
getChild in interface javax.swing.tree.TreeModelgetChild in class javax.swing.tree.DefaultTreeModelpublic int getChildCount(java.lang.Object parent)
getChildCount in interface javax.swing.tree.TreeModelgetChildCount in class javax.swing.tree.DefaultTreeModelpublic int getIndexOfChild(java.lang.Object parent,
java.lang.Object child)
getIndexOfChild in interface javax.swing.tree.TreeModelgetIndexOfChild in class javax.swing.tree.DefaultTreeModelpublic javax.swing.tree.TreeNode[] getPathToRoot(javax.swing.tree.TreeNode aNode)
getPathToRoot in class javax.swing.tree.DefaultTreeModelpublic void nodeChanged(javax.swing.tree.TreeNode node)
nodeChanged in class javax.swing.tree.DefaultTreeModelpublic void nodeStructureChanged(javax.swing.tree.TreeNode node)
nodeStructureChanged in class javax.swing.tree.DefaultTreeModelpublic void projectClosed(VPTProject p)
projectClosed in class ProjectTreeModelprotected void addChild(VPTProject proj, VPTNode child)
protected javax.swing.tree.TreeNode[] buildPathToRoot(javax.swing.tree.TreeNode aNode,
javax.swing.tree.TreeNode... children)
protected java.util.Map<VPTProject,java.util.List<VPTNode>> getCache()
protected java.util.List<VPTNode> getCachedChildren(VPTProject proj)
protected abstract java.util.List<VPTNode> getChildren(VPTProject proj)
proj - The project being queried.protected boolean isCustom()
isCustom in class ProjectTreeModelprotected void removeChild(VPTProject proj, VPTNode child)