Holger's
Java API

com.antelmann.io
Class FileTreeNode

java.lang.Object
  extended by com.antelmann.io.FileTreeNode
All Implemented Interfaces:
Refreshable, Serializable, TreeNode
Direct Known Subclasses:
DirectoryTreeNode

public class FileTreeNode
extends Object
implements TreeNode, Serializable, Refreshable

FileTreeNode implements a TreeNode that can be used to visualize a file structure. Both, directories and files are visible by default. Optionally, a FileFilter can be used to restrict the files in the tree.

Author:
Holger Antelmann
See Also:
DirectoryTreeNode, JTree, DefaultTreeModel, Serialized Form

Constructor Summary
FileTreeNode(File file)
          initializes the FileTreeNode with the given file
FileTreeNode(File file, FileFilter filter)
          initializes the FileTreeNode with the given file and filter
 
Method Summary
 Enumeration<?> children()
           
 boolean equals(Object obj)
           
 boolean getAllowsChildren()
           
 TreeNode getChildAt(int childIndex)
           
 int getChildCount()
           
 File getFile()
           
 FileFilter getFilter()
           
 int getIndex(TreeNode node)
           
 TreeNode getParent()
           
 int hashCode()
           
 boolean isLeaf()
           
 void refreshContent()
          refreshes the embedded content
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

FileTreeNode

public FileTreeNode(File file)
initializes the FileTreeNode with the given file


FileTreeNode

public FileTreeNode(File file,
                    FileFilter filter)
initializes the FileTreeNode with the given file and filter

Method Detail

refreshContent

public void refreshContent()
Description copied from interface: Refreshable
refreshes the embedded content

Specified by:
refreshContent in interface Refreshable

getFile

public File getFile()

getFilter

public FileFilter getFilter()

children

public Enumeration<?> children()
Specified by:
children in interface TreeNode

getChildCount

public int getChildCount()
Specified by:
getChildCount in interface TreeNode

getAllowsChildren

public boolean getAllowsChildren()
Specified by:
getAllowsChildren in interface TreeNode

getChildAt

public TreeNode getChildAt(int childIndex)
Specified by:
getChildAt in interface TreeNode

getIndex

public int getIndex(TreeNode node)
Specified by:
getIndex in interface TreeNode

isLeaf

public boolean isLeaf()
Specified by:
isLeaf in interface TreeNode

getParent

public TreeNode getParent()
Specified by:
getParent in interface TreeNode

equals

public boolean equals(Object obj)
Overrides:
equals in class Object

hashCode

public int hashCode()
Overrides:
hashCode in class Object

toString

public String toString()
Overrides:
toString in class Object


(c) Holger Antelmann since 2001- all rights reserved (contact: info@antelmann.com)
see www.antelmann.com/developer for further details and available downloads