public class PathTreeModel<N extends PathTreeNode> extends javax.swing.tree.DefaultTreeModel implements ApplicationObject<ApplicationContext>, Resetable
TreeModel implementation stores the PathTreeNodes of a file system tree which is watched by a
watch-service and thus reflects any changes in the file-system immediately.| Constructor and Description |
|---|
PathTreeModel(PathTreeModelDriver driver,
N rootTreeNode) |
| Modifier and Type | Method and Description |
|---|---|
protected N |
createPathTreeNode(N parent,
PathInfo childPathInfo)
Creates the
PathTreeNode to be inserted in the tree model. |
N |
findPathTreeNode(java.nio.file.Path path) |
N |
findPathTreeNode(PathInfo pathInfo) |
javax.swing.tree.TreePath |
findTreePath(java.nio.file.Path path) |
ApplicationContext |
getApplicationContext() |
PathTreeNode |
getChild(java.lang.Object parent,
int index) |
int |
getChildCount(java.lang.Object parent) |
int |
getIndexOfChild(java.lang.Object parent,
java.lang.Object child) |
N |
getRoot() |
boolean |
isLeaf(java.lang.Object node) |
void |
renamePath(java.nio.file.Path oldPath,
java.nio.file.Path newPath) |
void |
reset()
This method is called by the ResetButton on it's registered target.
|
void |
setRoot(javax.swing.tree.TreeNode root) |
addTreeModelListener, asksAllowsChildren, fireTreeNodesChanged, fireTreeNodesInserted, fireTreeNodesRemoved, fireTreeStructureChanged, getListeners, getPathToRoot, getPathToRoot, getTreeModelListeners, insertNodeInto, nodeChanged, nodesChanged, nodeStructureChanged, nodesWereInserted, nodesWereRemoved, reload, reload, removeNodeFromParent, removeTreeModelListener, setAsksAllowsChildren, valueForPathChangedpublic PathTreeModel(PathTreeModelDriver driver, N rootTreeNode)
public final N getRoot()
getRoot in interface javax.swing.tree.TreeModelgetRoot in class javax.swing.tree.DefaultTreeModelpublic final void setRoot(javax.swing.tree.TreeNode root)
setRoot in class javax.swing.tree.DefaultTreeModelpublic final void reset()
Resetablepublic PathTreeNode 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 boolean isLeaf(java.lang.Object node)
isLeaf in interface javax.swing.tree.TreeModelisLeaf 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 final N findPathTreeNode(java.nio.file.Path path)
public final javax.swing.tree.TreePath findTreePath(java.nio.file.Path path)
protected N createPathTreeNode(N parent, PathInfo childPathInfo)
PathTreeNode to be inserted in the tree model.
This method may be overridden to create a subclass instance of PathTreeNode.
Note that this PathTreeModel is generic to real type of the created PathTreeNode.public void renamePath(java.nio.file.Path oldPath,
java.nio.file.Path newPath)
throws java.io.IOException
java.io.IOExceptionpublic ApplicationContext getApplicationContext()
getApplicationContext in interface ApplicationObject<ApplicationContext>Copyright © 2011 EsprIT-Systems. All Rights Reserved.