SPT Core API

com.sptci.echo.tree.filesystem
Class FileSystemTreeNode

java.lang.Object
  extended by echopoint.tree.DefaultMutableTreeNode<M>
      extended by com.sptci.echo.tree.TreeNode<File>
          extended by com.sptci.echo.tree.filesystem.FileSystemTreeNode
All Implemented Interfaces:
MutableTreeNode<File>, TreeNode, Serializable

public class FileSystemTreeNode
extends TreeNode<File>

A tree node that represents a directory in the file system of the server on which the application is deployed.

© Copyright 2009 Sans Pareil Technologies, Inc.

Version:
$Id: FileSystemTreeNode.java 4858 2009-08-11 15:52:14Z rakesh $
Author:
Rakesh Vidyadharan 2009-06-14
See Also:
Serialized Form

Field Summary
 
Fields inherited from class com.sptci.echo.tree.TreeNode
initialised
 
Fields inherited from class echopoint.tree.DefaultMutableTreeNode
actionCommand, allowsChildren, children, EMPTY_ENUMERATION, parent, userObject
 
Constructor Summary
FileSystemTreeNode()
          Default constructor.
FileSystemTreeNode(File model)
          Create a tree node that represents the specified file.
FileSystemTreeNode(File model, boolean allowsChildren)
          Create a tree node that represents the specified file and that allows children based on the value specified.
 
Method Summary
protected  void createChildren()
          Create child nodes that represent the directories under the current directory.
 int getChildCount()
          Over-ridden to lazily initialise the child nodes and return the count.
 boolean isLeaf()
          Over-ridden to check whether the contents of the directory is readable or not.
 String toString()
          Over-ridden to return just the name of the directory.
 
Methods inherited from class echopoint.tree.DefaultMutableTreeNode
add, breadthFirstEnumeration, children, depthFirstEnumeration, getActionCommand, getAllowsChildren, getChildAfter, getChildAt, getChildBefore, getDepth, getFirstChild, getFirstLeaf, getIndex, getLastChild, getLastLeaf, getLeafCount, getLevel, getNextLeaf, getNextNode, getNextSibling, getParent, getPath, getPathToRoot, getPreviousLeaf, getPreviousNode, getPreviousSibling, getRoot, getSharedAncestor, getSiblingCount, getUserObject, getUserObjectPath, insert, isNodeAncestor, isNodeChild, isNodeDescendant, isNodeRelated, isNodeSibling, isRoot, pathFromAncestorEnumeration, postorderEnumeration, preorderEnumeration, remove, remove, removeAllChildren, removeFromParent, setActionCommand, setAllowsChildren, setParent, setUserObject
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

FileSystemTreeNode

public FileSystemTreeNode()
Default constructor. No special actions required.


FileSystemTreeNode

public FileSystemTreeNode(File model)
Create a tree node that represents the specified file.

Parameters:
model - The file (usually directory) that is being represented on the tree.

FileSystemTreeNode

public FileSystemTreeNode(File model,
                          boolean allowsChildren)
Create a tree node that represents the specified file and that allows children based on the value specified.

Parameters:
model - The file (usually directory) that is being displayed on the tree.
allowsChildren - Flag that indicates whether the node allows children.
Method Detail

isLeaf

public boolean isLeaf()
Over-ridden to check whether the contents of the directory is readable or not.

Specified by:
isLeaf in interface TreeNode
Overrides:
isLeaf in class TreeNode<File>
Returns:
false if the directory is readable.

getChildCount

public int getChildCount()
Over-ridden to lazily initialise the child nodes and return the count.

Specified by:
getChildCount in interface TreeNode
Overrides:
getChildCount in class DefaultMutableTreeNode<File>
Returns:
The child count after initialising the children.

toString

public String toString()
Over-ridden to return just the name of the directory.

Overrides:
toString in class DefaultMutableTreeNode<File>

createChildren

protected void createChildren()
Create child nodes that represent the directories under the current directory.


SPT Core API