projectviewer.vpt
Class VPTWorkingFileListModel

java.lang.Object
  extended byjavax.swing.tree.DefaultTreeModel
      extended byprojectviewer.vpt.VPTWorkingFileListModel
All Implemented Interfaces:
java.io.Serializable, javax.swing.tree.TreeModel

public class VPTWorkingFileListModel
extends javax.swing.tree.DefaultTreeModel

A tree model that shows all files currently opened in jEdit in a flat list.

Version:
$Id: VPTWorkingFileListModel.java 9433 2007-04-15 01:45:09Z vanza $
Author:
Marcelo Vanzin
See Also:
Serialized Form

Field Summary
 
Fields inherited from class javax.swing.tree.DefaultTreeModel
asksAllowsChildren, listenerList, root
 
Constructor Summary
VPTWorkingFileListModel(VPTNode rootNode)
          Create a new VPTFileListModel.
 
Method Summary
 void addOpenFile(java.lang.String path)
          Adds an open file to the list of open files of the projects to which it belongs.
 void cleanup(VPTProject p)
           
 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 child at the given index of the given parent.
 javax.swing.tree.TreeNode[] getPathToRoot(javax.swing.tree.TreeNode aNode)
           
 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 removeOpenFile(java.lang.String path)
          Removes an open file from the list of open files of the projects to which it belongs.
 
Methods inherited from class javax.swing.tree.DefaultTreeModel
addTreeModelListener, asksAllowsChildren, fireTreeNodesChanged, fireTreeNodesInserted, fireTreeNodesRemoved, fireTreeStructureChanged, getIndexOfChild, getListeners, getPathToRoot, getRoot, getTreeModelListeners, insertNodeInto, isLeaf, nodesChanged, nodesWereInserted, nodesWereRemoved, reload, reload, removeNodeFromParent, removeTreeModelListener, setAsksAllowsChildren, setRoot, valueForPathChanged
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

VPTWorkingFileListModel

public VPTWorkingFileListModel(VPTNode rootNode)
Create a new VPTFileListModel.

Parameters:
rootNode - The root node of the tree.
Method Detail

getChildCount

public int getChildCount(java.lang.Object parent)
Returns the child at the given index of the given parent. If the parent is a project, returns the number of files in the project, not just the files that are direct children of the project.


getChild

public java.lang.Object getChild(java.lang.Object parent,
                                 int index)
Returns the child at the given index of the given parent. If the parent is a project, treats the children in such a way to allow all files in the project to be displayed in a flat list.


nodeStructureChanged

public void nodeStructureChanged(javax.swing.tree.TreeNode node)
Called when some node in the tree is changed. If not the root, then tracks down which project was changed and updates the child list.


addOpenFile

public void addOpenFile(java.lang.String path)
Adds an open file to the list of open files of the projects to which it belongs.


removeOpenFile

public void removeOpenFile(java.lang.String path)
Removes an open file from the list of open files of the projects to which it belongs.


getPathToRoot

public javax.swing.tree.TreeNode[] getPathToRoot(javax.swing.tree.TreeNode aNode)

nodeChanged

public void nodeChanged(javax.swing.tree.TreeNode node)
Handles a node changed request.


cleanup

public void cleanup(VPTProject p)