com.sun.xfilechooser
Class XFileSystemView

java.lang.Object
  |
  +--javax.swing.filechooser.FileSystemView
        |
        +--com.sun.xfilechooser.XFileSystemView

public abstract class XFileSystemView
extends javax.swing.filechooser.FileSystemView

XFileSystemView class allows the XFileChooser to provide XFile object data to the FileSystemView of the JFileChooser. This class overrides the FileSystemView provided by JFileChooser. Whenever an XFileChooser constructor is called the FileSystemView that is set would be the XFileSystemView.


Constructor Summary
XFileSystemView()
           
 
Method Summary
 java.io.File createFileObject(java.io.File dir, java.lang.String filename)
          Creates a File object constructed from File obj and filename
 java.io.File createFileObject(java.lang.String path)
          Creates a file object constructed from give pathname
 java.io.File[] getFiles(java.io.File dir, boolean useFileHiding)
          Returns the list of files in a directory
static javax.swing.filechooser.FileSystemView getFileSystemView()
          Depending on type of operating system (e.g.
 java.io.File getHomeDirectory()
          Returns the user's home directory
 java.io.File getParentDirectory(java.io.File dir)
          Returns the parent directory of specified directory/file object
 boolean isRoot(java.io.File f)
          Returns true if the given file object is root.
 
Methods inherited from class javax.swing.filechooser.FileSystemView
createNewFolder, getRoots, isHiddenFile
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

XFileSystemView

public XFileSystemView()
Method Detail

getFileSystemView

public static javax.swing.filechooser.FileSystemView getFileSystemView()
Depending on type of operating system (e.g. unix, windows, or generic) it would return the file system view.
Returns:
FileSystemView the operating system file system view

createFileObject

public java.io.File createFileObject(java.io.File dir,
                                     java.lang.String filename)
Creates a File object constructed from File obj and filename
Parameters:
dir - file object of directory
filename - name of file in directory
Returns:
File object created
Overrides:
createFileObject in class javax.swing.filechooser.FileSystemView

createFileObject

public java.io.File createFileObject(java.lang.String path)
Creates a file object constructed from give pathname
Returns:
File object constructed from the given path string.
Overrides:
createFileObject in class javax.swing.filechooser.FileSystemView

getFiles

public java.io.File[] getFiles(java.io.File dir,
                               boolean useFileHiding)
Returns the list of files in a directory
Parameters:
dir - directory
useFileHiding - flag to indicate to either show files hidden or not.
Returns:
File[] array of files in the directory
Overrides:
getFiles in class javax.swing.filechooser.FileSystemView

getHomeDirectory

public java.io.File getHomeDirectory()
Returns the user's home directory
Returns:
File object of user's home directory
Overrides:
getHomeDirectory in class javax.swing.filechooser.FileSystemView

getParentDirectory

public java.io.File getParentDirectory(java.io.File dir)
Returns the parent directory of specified directory/file object
Parameters:
dir - directory
Returns:
parent directory
Overrides:
getParentDirectory in class javax.swing.filechooser.FileSystemView

isRoot

public boolean isRoot(java.io.File f)
Returns true if the given file object is root.
Parameters:
f - file object to check if root
Returns:
boolean value if file object is root (true) or not (false)
Overrides:
isRoot in class javax.swing.filechooser.FileSystemView