Quaqua 5.4.1 2009-07-14

ch.randelshofer.quaqua.filechooser
Class AliasFileSystemTreeModel.DirectoryNode

java.lang.Object
  extended by ch.randelshofer.quaqua.filechooser.AliasFileSystemTreeModel.Node
      extended by ch.randelshofer.quaqua.filechooser.AliasFileSystemTreeModel.DirectoryNode
All Implemented Interfaces:
FileInfo, javax.swing.tree.MutableTreeNode, javax.swing.tree.TreeNode
Direct Known Subclasses:
AliasFileSystemTreeModel.AliasDirectoryNode
Enclosing class:
AliasFileSystemTreeModel

public class AliasFileSystemTreeModel.DirectoryNode
extends AliasFileSystemTreeModel.Node

This is the implementation for a directory node (a composite node).


Field Summary
 
Fields inherited from class ch.randelshofer.quaqua.filechooser.AliasFileSystemTreeModel.Node
collationKey, file, fileLabel, icon, isAcceptable, parent, userName
 
Constructor Summary
AliasFileSystemTreeModel.DirectoryNode(java.io.File file)
           
 
Method Summary
 void autoValidateChildren()
          Validates this node if automatic validation is on and if it is invalid.
 java.util.Enumeration children()
           
 boolean getAllowsChildren()
           
 javax.swing.tree.TreeNode getChildAt(int childIndex)
           
 int getChildCount()
           
protected  long getDirectoryTTL()
           
 java.lang.String getFileKind()
          Returns the kind of the file.
 long getFileLength()
          Returns the length of the file.
protected  java.io.File[] getFiles()
           
 int getIndex(javax.swing.tree.TreeNode node)
           
 void insert(javax.swing.tree.MutableTreeNode newChild, int childIndex)
           
 void invalidateChildren()
          Marks this node as invalid.
 void invalidateTree()
          Marks this subtree as invalid.
 boolean isLeaf()
           
 boolean isValidatingChildren()
           
 void lazyInvalidateChildren()
          Marks the children of this node as invalid.
 void remove(int childIndex)
           
 void remove(javax.swing.tree.MutableTreeNode aChild)
           
 void stopValidationSubtree()
           
 void validateChildren()
          Validates this node if it is invalid.
 
Methods inherited from class ch.randelshofer.quaqua.filechooser.AliasFileSystemTreeModel.Node
getCollationKey, getFile, getFileLabel, getIcon, getParent, getPath, getPathToRoot, getResolvedFile, getRoot, getUserName, invalidateInfo, isAcceptable, isAlias, isNodeAncestor, isTraversable, isValidating, lazyGetResolvedFile, removeFromParent, setParent, setUserObject, toString, validateInfo
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

AliasFileSystemTreeModel.DirectoryNode

public AliasFileSystemTreeModel.DirectoryNode(java.io.File file)
Method Detail

getFileLength

public long getFileLength()
Description copied from interface: FileInfo
Returns the length of the file. Returns -1 if the length has not (yet) been determined.

Specified by:
getFileLength in interface FileInfo
Overrides:
getFileLength in class AliasFileSystemTreeModel.Node

getFileKind

public java.lang.String getFileKind()
Description copied from interface: FileInfo
Returns the kind of the file. Returns null if the kind has not (yet) been determined.

Specified by:
getFileKind in interface FileInfo
Overrides:
getFileKind in class AliasFileSystemTreeModel.Node

invalidateChildren

public void invalidateChildren()
Marks this node as invalid. If the node denotes not a directory, nothing happens.

Overrides:
invalidateChildren in class AliasFileSystemTreeModel.Node

lazyInvalidateChildren

public void lazyInvalidateChildren()
Marks the children of this node as invalid. This has only an effect, if this node denotes a directory.

Overrides:
lazyInvalidateChildren in class AliasFileSystemTreeModel.Node

isValidatingChildren

public boolean isValidatingChildren()
Overrides:
isValidatingChildren in class AliasFileSystemTreeModel.Node

stopValidationSubtree

public void stopValidationSubtree()
Overrides:
stopValidationSubtree in class AliasFileSystemTreeModel.Node

invalidateTree

public void invalidateTree()
Marks this subtree as invalid.

Overrides:
invalidateTree in class AliasFileSystemTreeModel.Node

validateChildren

public void validateChildren()
Validates this node if it is invalid. If this node is invalid, a worker thread is launched, which reads the directory denoted by this node and merges it with the existing children of this node. If the node denotes not a directory, nothing happens.

Overrides:
validateChildren in class AliasFileSystemTreeModel.Node

autoValidateChildren

public void autoValidateChildren()
Validates this node if automatic validation is on and if it is invalid.


children

public java.util.Enumeration children()
Specified by:
children in interface javax.swing.tree.TreeNode
Overrides:
children in class AliasFileSystemTreeModel.Node

getAllowsChildren

public boolean getAllowsChildren()
Specified by:
getAllowsChildren in interface javax.swing.tree.TreeNode
Overrides:
getAllowsChildren in class AliasFileSystemTreeModel.Node

getChildAt

public javax.swing.tree.TreeNode getChildAt(int childIndex)
Specified by:
getChildAt in interface javax.swing.tree.TreeNode
Overrides:
getChildAt in class AliasFileSystemTreeModel.Node

getChildCount

public int getChildCount()
Specified by:
getChildCount in interface javax.swing.tree.TreeNode
Overrides:
getChildCount in class AliasFileSystemTreeModel.Node

getIndex

public int getIndex(javax.swing.tree.TreeNode node)
Specified by:
getIndex in interface javax.swing.tree.TreeNode
Overrides:
getIndex in class AliasFileSystemTreeModel.Node

insert

public void insert(javax.swing.tree.MutableTreeNode newChild,
                   int childIndex)
Specified by:
insert in interface javax.swing.tree.MutableTreeNode
Overrides:
insert in class AliasFileSystemTreeModel.Node

isLeaf

public boolean isLeaf()
Specified by:
isLeaf in interface javax.swing.tree.TreeNode
Overrides:
isLeaf in class AliasFileSystemTreeModel.Node

remove

public void remove(javax.swing.tree.MutableTreeNode aChild)
Specified by:
remove in interface javax.swing.tree.MutableTreeNode
Overrides:
remove in class AliasFileSystemTreeModel.Node

remove

public void remove(int childIndex)
Specified by:
remove in interface javax.swing.tree.MutableTreeNode
Overrides:
remove in class AliasFileSystemTreeModel.Node

getFiles

protected java.io.File[] getFiles()

getDirectoryTTL

protected long getDirectoryTTL()

Copyright 2003-2007 (c) Werner Randelshofer.
All rights reserved.