Package org.jjazz.uiutilities.api
Class SingleRootFileSystemView
java.lang.Object
javax.swing.filechooser.FileSystemView
org.jjazz.uiutilities.api.SingleRootFileSystemView
A FileSystemView class that limits the file selections to a single root.
When used with the JFileChooser component the user will only be able to traverse the directories contained within the specified root fill.
The "Look In" combo box will only display the specified root.
The "Up One Level" button will be disable when at the root.
Thanks to Rob Camick. This class is designed to be used once, for one ROOT directory. To limit the file chooser to search the
files in my Java JDK I used:
File root = new File("c:/java/jdk6.7");
FileSystemView fsv = new SingleRootFileSystemView( root );
JFileChooser chooser = new JFileChooser(fsv);
-
Constructor Summary
-
Method Summary
Methods inherited from class javax.swing.filechooser.FileSystemView
createFileObject, createFileObject, getChild, getChooserComboBoxFiles, getChooserShortcutPanelFiles, getFiles, getFileSystemView, getLinkLocation, getParentDirectory, getSystemDisplayName, getSystemIcon, getSystemIcon, getSystemTypeDescription, isComputerNode, isDrive, isFileSystem, isFileSystemRoot, isFloppyDrive, isHiddenFile, isLink, isParent, isRoot, isTraversable
-
Constructor Details
-
SingleRootFileSystemView
-
-
Method Details
-
createNewFolder
- Specified by:
createNewFolder
in classFileSystemView
-
getDefaultDirectory
- Overrides:
getDefaultDirectory
in classFileSystemView
-
getHomeDirectory
- Overrides:
getHomeDirectory
in classFileSystemView
-
getRoots
- Overrides:
getRoots
in classFileSystemView
-