projectviewer.vpt
Class VPTDirectory

java.lang.Object
  extended by javax.swing.tree.DefaultMutableTreeNode
      extended by projectviewer.vpt.VPTNode
          extended by projectviewer.vpt.VPTDirectory
All Implemented Interfaces:
java.io.Serializable, java.lang.Cloneable, java.lang.Comparable<VPTNode>, javax.swing.tree.MutableTreeNode, javax.swing.tree.TreeNode

public class VPTDirectory
extends VPTNode

Models a directory that is part of a project.

Author:
Marcelo Vanzin
See Also:
Serialized Form

Field Summary
protected  java.lang.String url
           
 
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.lang.String url)
           
 
Method Summary
 boolean canRename()
          Returns whether the VFS of the file allows renaming.
 boolean canWrite()
          Returns is the underlying file is writable.
 int compareTo(VPTNode node)
          Directories have precedende over openable nodes...
 boolean delete()
          Deleting directories is not supported.
 java.lang.String getFileName()
          Returns the real name of this directory.
 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.
 java.lang.String getURL()
          Returns the URL of this directory.
 boolean isDirectory()
          Returns true if this node is a VPTDirectory.
 void setURL(java.lang.String url)
          Changes this directory's URL.
 java.lang.String toString()
          Returns a string representation of the current node.
 
Methods inherited from class projectviewer.vpt.VPTNode
canOpen, changed, close, compareName, findIndexForChild, findProjectFor, getBackgroundColor, getChildWithName, getClipType, getForegroundColor, getGroup, getLock, getName, getVersionControlState, insert, isFile, isGroup, isOpened, isProject, isRoot, lock, open, persistChildren, remove, remove, removeAllChildren, removeFromParent, setName, setParent, setVersionControlState, sortChildren, sortChildren, unlock
 
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, isLeaf, isNodeAncestor, isNodeChild, isNodeDescendant, isNodeRelated, isNodeSibling, pathFromAncestorEnumeration, postorderEnumeration, preorderEnumeration, setAllowsChildren, setUserObject
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

url

protected java.lang.String url
Constructor Detail

VPTDirectory

public VPTDirectory(java.lang.String url)
Method Detail

getURL

public java.lang.String getURL()
Returns the URL of this directory.

Since:
PV 3.0.0

setURL

public void setURL(java.lang.String url)
Changes this directory's URL.

Since:
PV 3.0.0

getFileName

public java.lang.String getFileName()
Returns the real name of this directory.


canWrite

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

Overrides:
canWrite in class VPTNode

canRename

public boolean canRename()
Returns whether the VFS of the file allows renaming.

Overrides:
canRename in class VPTNode
Returns:
Default implementation returns true.
Since:
PV 3.0.0

delete

public boolean delete()
Deleting directories is not supported.

Overrides:
delete in class VPTNode
Returns:
false

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

isDirectory

public boolean isDirectory()
Description copied from class: VPTNode
Returns true if this node is a VPTDirectory.

Overrides:
isDirectory 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

compareTo

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

Specified by:
compareTo in interface java.lang.Comparable<VPTNode>
Overrides:
compareTo in class VPTNode