Java FileSystem TreeModel

A TreeModel implementation that reads the underlying file system to generate the tree nodes.

This implementation is dead-simple — no automatic refresh when the file system changes, no model events, no nothing.

Potential Uses

This library should be useful in editors, preferences panels, etc. Basically, anywhere a simple filesystem needs to be shown. Since it doesn't have many options, the API is dead easy to understand.

Requisite Screenshot

Screenshot of SimpleTreeView - the sample that comes with the library

The model was instantiated with the root being the project's source folder.

You also have to realize that this is a TreeModel, not a JTree reimplementation. So, the icons and everything else is the base JTree. Use JGoodies Looks for a different look'n'feel for your applications.

Usage

A simple instantiation of FileSystemTreeModel with the tree's root as a File instance is all you need:

JTree tree = new JTree();
File fileSystemRoot = new File(".").getCanonicalFile();
tree.setModel(new FileSystemTreeModel(root));

API Documentation

The API documentation is available here.

Compatibility

This library was built with Java 2 1.3 in mind. No 1.4 or 1.5 features are used. The library is compiled on the 1.4 platform, but should directly run using any 1.3 or better platform.

Javac's target option is used to generate 1.3 class files. See the Ant build file for details.

Contact

Please contact fbos@users.sourceforge.net (François Beausoleil) for any requests, bugs or other information.

License

Oh yeah, I almost forgot… This library is distributed under no license, meaning it's in the public domain. You may do as you wish with it — sell it, destroy it, use it, not use it, etc.

If you do use it, I would appreciate a quick E-Mail to tell me so, but beyond that, nothing is required.

Enjoy !

Source Code

You must use Subversion to access this project's source code. See the Subversion Book for reference information and general usage information.

To checkout, once you have installed Subversion:

$ svn checkout http://opensvn.csie.org/fstreem/trunk

To get a list of releases, visit http://opensvn.csie.org/fstreem/tags/.

Release History / Changes

October 4, 2004 - v0.1
Initial release
SourceForge.net Logo