Quaqua 7.4.2 2011-07-05

ch.randelshofer.quaqua.filechooser
Class QuaquaFileSystemView

java.lang.Object
  extended by javax.swing.filechooser.FileSystemView
      extended by ch.randelshofer.quaqua.filechooser.FileSystemViewFilter
          extended by ch.randelshofer.quaqua.filechooser.QuaquaFileSystemView
Direct Known Subclasses:
DarwinLeopardFileSystemView, LinuxFileSystemView, OSX16SnowLeopardFileSystemView, OSXJaguarFileSystemView, OSXLeopardFileSystemView, OSXPantherFileSystemView, OSXTigerFileSystemView, WindowsFileSystemView

public abstract class QuaquaFileSystemView
extends FileSystemViewFilter

QuaquaFileSystemView is an enhanced FileSystemView, which provides additional information about a file system required for Aqua file choosers. QuaquaFileSystemView acts as a wrapper on platform specific file system views. The resulting view is an Aqua-style view on the file system.

Version:
$Id: QuaquaFileSystemView.java 363 2010-11-21 17:41:04Z wrandelshofer $
Author:
Werner Randelshofer

Field Summary
 
Fields inherited from class ch.randelshofer.quaqua.filechooser.FileSystemViewFilter
target
 
Constructor Summary
QuaquaFileSystemView()
          Creates a new instance.
 
Method Summary
 javax.swing.filechooser.FileView createFileView(javax.swing.JFileChooser chooser)
          Creates a system specific file view for the specified JFileChooser.
abstract  java.io.File getComputer()
          Returns the file that represents this computer node.
static QuaquaFileSystemView getQuaquaFileSystemView()
          Returns a FileSystemView that can be cast into QuaquaFileSystemView.
 java.lang.String getSystemDisplayName(java.io.File f)
          Name of a file, directory, or folder as it would be displayed in a system file browser.
 javax.swing.Icon getSystemIcon(java.io.File f)
          Icon for a file, directory, or folder as it would be displayed in a system file browser.
 java.lang.String getSystemTypeDescription(java.io.File f)
          Type description for a file, directory, or folder as it would be displayed in a system file browser.
abstract  java.io.File getSystemVolume()
          Returns the file that represents the system (boot) volume of this computer.
 java.lang.Boolean isTraversable(java.io.File f)
          Returns true if the file (directory) can be visited.
static void setQuaquaFileSystemView(QuaquaFileSystemView newValue)
          Sets the QuaquaFileSystemView.
 
Methods inherited from class ch.randelshofer.quaqua.filechooser.FileSystemViewFilter
createFileObject, createFileObject, createNewFolder, getChild, getDefaultDirectory, getFiles, getHomeDirectory, getParentDirectory, getRoots, isComputerNode, isDrive, isFileSystem, isFileSystemRoot, isFloppyDrive, isHiddenFile, isParent, isRoot
 
Methods inherited from class javax.swing.filechooser.FileSystemView
createFileSystemRoot, getFileSystemView
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

QuaquaFileSystemView

public QuaquaFileSystemView()
Creates a new instance.

Method Detail

getComputer

public abstract java.io.File getComputer()
Returns the file that represents this computer node.


getSystemVolume

public abstract java.io.File getSystemVolume()
Returns the file that represents the system (boot) volume of this computer.


createFileView

public javax.swing.filechooser.FileView createFileView(javax.swing.JFileChooser chooser)
Creates a system specific file view for the specified JFileChooser.


getQuaquaFileSystemView

public static QuaquaFileSystemView getQuaquaFileSystemView()
Returns a FileSystemView that can be cast into QuaquaFileSystemView.


setQuaquaFileSystemView

public static void setQuaquaFileSystemView(QuaquaFileSystemView newValue)
Sets the QuaquaFileSystemView. Set this to null, if you want Quaqua determine which file system view to use.


getSystemIcon

public javax.swing.Icon getSystemIcon(java.io.File f)
Icon for a file, directory, or folder as it would be displayed in a system file browser. Example from Windows: the "M:\" directory displays a CD-ROM icon. The default implementation gets information from the ShellFolder class.

Overrides:
getSystemIcon in class FileSystemViewFilter
Parameters:
f - a File object
Returns:
an icon as it would be displayed by a native file chooser
See Also:
JFileChooser.getIcon(java.io.File)

getSystemTypeDescription

public java.lang.String getSystemTypeDescription(java.io.File f)
Type description for a file, directory, or folder as it would be displayed in a system file browser. Example from Windows: the "Desktop" folder is desribed as "Desktop". Override for platforms with native ShellFolder implementations.

Overrides:
getSystemTypeDescription in class FileSystemViewFilter
Parameters:
f - a File object
Returns:
the file type description as it would be displayed by a native file chooser or null if no native information is available.
See Also:
JFileChooser.getTypeDescription(java.io.File)

isTraversable

public java.lang.Boolean isTraversable(java.io.File f)
Returns true if the file (directory) can be visited. Returns false if the directory cannot be traversed.

Overrides:
isTraversable in class FileSystemViewFilter
Parameters:
f - the File
Returns:
true if the file/directory can be traversed, otherwise false
See Also:
JFileChooser.isTraversable(java.io.File), FileView.isTraversable(java.io.File)

getSystemDisplayName

public java.lang.String getSystemDisplayName(java.io.File f)
Name of a file, directory, or folder as it would be displayed in a system file browser. Example from Windows: the "M:\" directory displays as "CD-ROM (M:)" The default implementation gets information from the ShellFolder class.

Overrides:
getSystemDisplayName in class FileSystemViewFilter
Parameters:
f - a File object
Returns:
the file name as it would be displayed by a native file chooser
See Also:
JFileChooser.getName(java.io.File)

Copyright 2003-2007 (c) Werner Randelshofer.
All rights reserved.