org.argouml.util.osdep.win32
Class Win32FileSystemView

java.lang.Object
  extended byjavax.swing.filechooser.FileSystemView
      extended byorg.argouml.util.osdep.win32.Win32FileSystemView

public class Win32FileSystemView
extends FileSystemView

This class is necessary due to an annoying bug on Windows NT where instantiating a JFileChooser with the default FileSystemView will cause a "drive A: not ready" error every time. I grabbed the Windows FileSystemView impl from the 1.3 SDK and modified it so as to not use java.io.File.listRoots() to get fileSystem roots. java.io.File.listRoots() does a SecurityManager.checkRead() which causes the OS to try to access drive A: even when there is no disk, causing an annoying "abort, retry, ignore" popup message every time we instantiate a JFileChooser! Instead of calling listRoots() we use a straightforward alternate method of getting file system roots.

Since:
ARGO0.9.8

Nested Class Summary
(package private)  class Win32FileSystemView.FileSystemRoot
           
 
Field Summary
 
Fields inherited from class javax.swing.filechooser.FileSystemView
 
Constructor Summary
Win32FileSystemView()
          The constructor.
 
Method Summary
 File createNewFolder(File containingDir)
          Creates a new folder with a default folder name.
 File[] getRoots()
          Returns all root partitians on this system.
 boolean isHiddenFile(File f)
          Returns whether a file is hidden or not.
 boolean isRoot(File f)
          Returns true if the given file is a root.
 
Methods inherited from class javax.swing.filechooser.FileSystemView
createFileObject, createFileObject, createFileSystemRoot, getChild, getDefaultDirectory, getFiles, getFileSystemView, getHomeDirectory, getParentDirectory, getSystemDisplayName, getSystemIcon, getSystemTypeDescription, isComputerNode, isDrive, isFileSystem, isFileSystemRoot, isFloppyDrive, isParent, isTraversable
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Win32FileSystemView

public Win32FileSystemView()
The constructor.

Method Detail

isRoot

public boolean isRoot(File f)
Returns true if the given file is a root.

See Also:
FileSystemView.isRoot(java.io.File)

createNewFolder

public File createNewFolder(File containingDir)
                     throws IOException
Creates a new folder with a default folder name.

Throws:
IOException
See Also:
FileSystemView.createNewFolder(java.io.File)

isHiddenFile

public boolean isHiddenFile(File f)
Returns whether a file is hidden or not. On Windows there is currently no way to get this information from io.File, therefore always return false.

See Also:
FileSystemView.isHiddenFile(java.io.File)

getRoots

public File[] getRoots()
Returns all root partitians on this system. On Windows, this will be the A: through Z: drives. Note - This appears to bypass the B drive! Should we treat the B drive the same as the A drive, or should we continue to bypass it?

See Also:
FileSystemView.getRoots()


ArgoUML © 1996-2004 (20050222)ArgoUML HomepageArgoUML Developers' pageArgoUML Cookbook