projectviewer.vpt
Class VPTDirectory

java.lang.Object
  extended byjavax.swing.tree.DefaultMutableTreeNode
      extended byprojectviewer.vpt.VPTNode
          extended byprojectviewer.vpt.VPTDirectory
All Implemented Interfaces:
java.lang.Cloneable, java.lang.Comparable, javax.swing.tree.MutableTreeNode, java.io.Serializable, javax.swing.tree.TreeNode
Direct Known Subclasses:
VPTCompactModel.CompactDirectoryNode, VPTFilteredModel.FilteredDirectoryNode

public class VPTDirectory
extends VPTNode

Models a directory that is part of a project.

Version:
$Id: VPTDirectory.java 8932 2007-02-09 05:29:17Z vanza $
Author:
Marcelo Vanzin
See Also:
Serialized Form

Field Summary
protected  java.io.File file
           
 
Fields inherited from class projectviewer.vpt.VPTNode
name, treeNoSelectionBackground, treeNoSelectionForeground, treeSelectionBackground, treeSelectionForeground
 
Fields inherited from class javax.swing.tree.DefaultMutableTreeNode
allowsChildren, children, EMPTY_ENUMERATION, parent, userObject
 
Constructor Summary
VPTDirectory(java.io.File file)
           
VPTDirectory(java.lang.String path)
           
 
Method Summary
 boolean canWrite()
          Returns is the underlying file is writable.
 int compareToNode(VPTNode node)
          Directories have precedende over openable nodes...
 boolean delete()
          Deletes the file from disk and removes it from the current container.
 java.io.File getFile()
          Return the file associated with this node.
 javax.swing.Icon getIcon(boolean expanded)
          Returns the icon to be shown on the tree next to the node name.
 java.lang.String getNodePath()
          Returns the path to the file represented by this node.
 void setFile(java.io.File f)
          Sets the file associated with this node.
 java.lang.String toString()
          Returns a string representation of the current node.
 
Methods inherited from class projectviewer.vpt.VPTNode
canOpen, close, compareName, compareTo, findIndexForChild, findProjectFor, getBackgroundColor, getChildWithName, getClipType, getForegroundColor, getName, isDirectory, isFile, isGroup, isOpened, isProject, isRoot, open, persistChildren, setName, setParent, sortChildren, sortChildren
 
Methods inherited from class javax.swing.tree.DefaultMutableTreeNode
add, breadthFirstEnumeration, children, clone, depthFirstEnumeration, getAllowsChildren, getChildAfter, getChildAt, getChildBefore, getChildCount, getDepth, getFirstChild, getFirstLeaf, getIndex, getLastChild, getLastLeaf, getLeafCount, getLevel, getNextLeaf, getNextNode, getNextSibling, getParent, getPath, getPathToRoot, getPreviousLeaf, getPreviousNode, getPreviousSibling, getRoot, getSharedAncestor, getSiblingCount, getUserObject, getUserObjectPath, insert, isLeaf, isNodeAncestor, isNodeChild, isNodeDescendant, isNodeRelated, isNodeSibling, pathFromAncestorEnumeration, postorderEnumeration, preorderEnumeration, remove, remove, removeAllChildren, removeFromParent, setAllowsChildren, setUserObject
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

file

protected java.io.File file
Constructor Detail

VPTDirectory

public VPTDirectory(java.lang.String path)

VPTDirectory

public VPTDirectory(java.io.File file)
Method Detail

canWrite

public boolean canWrite()
Returns is the underlying file is writable.

Overrides:
canWrite in class VPTNode

delete

public boolean delete()
Deletes the file from disk and removes it from the current container.

Overrides:
delete in class VPTNode
Returns:
Whether the deletion was successful or not.

getFile

public java.io.File getFile()
Return the file associated with this node.


getIcon

public javax.swing.Icon getIcon(boolean expanded)
Returns the icon to be shown on the tree next to the node name.

Specified by:
getIcon in class VPTNode
Parameters:
expanded - If the node is currently expanded or not.

toString

public java.lang.String toString()
Returns a string representation of the current node.

Overrides:
toString in class VPTNode

getNodePath

public java.lang.String getNodePath()
Returns the path to the file represented by this node.

Specified by:
getNodePath in class VPTNode

setFile

public void setFile(java.io.File f)
Sets the file associated with this node.


compareToNode

public int compareToNode(VPTNode node)
Directories have precedende over openable nodes...

Overrides:
compareToNode in class VPTNode