kiwi.ui.model
Class FilesystemDataSource

java.lang.Object
  |
  +--kiwi.ui.model.FilesystemDataSource

public class FilesystemDataSource
extends Object
implements HierarchicalDataSource

This class is an implementation of HierarchicalDataSource wherein tree nodes represent files in the local filesystem. The ignoreFiles argument of some forms of the constructor allows for the creation of directory-only data sources. These are useful for driving a directory chooser, for example.

Version:
1.1 (11/98)
Author:
Mark Lindner, PING Software Group
See Also:
File

Constructor Summary
FilesystemDataSource(boolean ignoreFiles)
          Construct a new FilesystemDataSource with a default root corresponding to the root of the default (or current) filesystem.
FilesystemDataSource(File root)
          Construct a new FilesystemDataSource.
FilesystemDataSource(File root, boolean ignoreFiles)
          Construct a new FilesystemDataSource.
 
Method Summary
 Object[] getChildren(ITreeNode node)
          Get the children of a given node.
 Object getRoot()
          Get the root object.
 Object getValueForProperty(ITreeNode node, String property)
          Get the value for a given property.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FilesystemDataSource

public FilesystemDataSource(File root)
Construct a new FilesystemDataSource.
Parameters:
root - The root of the filesystem for this datasource.

FilesystemDataSource

public FilesystemDataSource(boolean ignoreFiles)
Construct a new FilesystemDataSource with a default root corresponding to the root of the default (or current) filesystem.
Parameters:
ignoreFiles - A flag specifying whether ordinary files (non-directories) should be ignored or displayed.

FilesystemDataSource

public FilesystemDataSource(File root,
                            boolean ignoreFiles)
Construct a new FilesystemDataSource.
Parameters:
root - The root directory.
ignoreFiles - A flag specifying whether ordinary files (non-directories) should be ignored or displayed.
Throws:
IllegalArgumentException - if root is not a directory.
Method Detail

getRoot

public Object getRoot()
Get the root object.
Specified by:
getRoot in interface HierarchicalDataSource

getChildren

public Object[] getChildren(ITreeNode node)
Get the children of a given node.
Specified by:
getChildren in interface HierarchicalDataSource

getValueForProperty

public Object getValueForProperty(ITreeNode node,
                                  String property)
Get the value for a given property.
Specified by:
getValueForProperty in interface HierarchicalDataSource