Package 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
Constructors Constructor Description XFileSystemView()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description java.io.File
createFileObject(java.io.File dir, java.lang.String filename)
Creates a File object constructed from File obj and filenamejava.io.File
createFileObject(java.lang.String path)
Creates a file object constructed from give pathnamejava.io.File[]
getFiles(java.io.File dir, boolean useFileHiding)
Returns the list of files in a directorystatic javax.swing.filechooser.FileSystemView
getFileSystemView()
Depending on type of operating system (e.g.java.io.File
getHomeDirectory()
Returns the user's home directoryjava.io.File
getParentDirectory(java.io.File dir)
Returns the parent directory of specified directory/file objectboolean
isRoot(java.io.File f)
Returns true if the given file object is root.-
Methods inherited from class javax.swing.filechooser.FileSystemView
createFileSystemRoot, createNewFolder, getChild, getChooserComboBoxFiles, getDefaultDirectory, getLinkLocation, getRoots, getSystemDisplayName, getSystemIcon, getSystemTypeDescription, isComputerNode, isDrive, isFileSystem, isFileSystemRoot, isFloppyDrive, isHiddenFile, isLink, isParent, isTraversable
-
-
-
-
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- Overrides:
createFileObject
in classjavax.swing.filechooser.FileSystemView
- Parameters:
dir
- file object of directoryfilename
- name of file in directory- Returns:
- File object created
-
createFileObject
public java.io.File createFileObject(java.lang.String path)
Creates a file object constructed from give pathname- Overrides:
createFileObject
in classjavax.swing.filechooser.FileSystemView
- Returns:
- File object constructed from the given path string.
-
getFiles
public java.io.File[] getFiles(java.io.File dir, boolean useFileHiding)
Returns the list of files in a directory- Overrides:
getFiles
in classjavax.swing.filechooser.FileSystemView
- Parameters:
dir
- directoryuseFileHiding
- flag to indicate to either show files hidden or not.- Returns:
- File[] array of files in the directory
-
getHomeDirectory
public java.io.File getHomeDirectory()
Returns the user's home directory- Overrides:
getHomeDirectory
in classjavax.swing.filechooser.FileSystemView
- Returns:
- File object of user's home directory
-
getParentDirectory
public java.io.File getParentDirectory(java.io.File dir)
Returns the parent directory of specified directory/file object- Overrides:
getParentDirectory
in classjavax.swing.filechooser.FileSystemView
- Parameters:
dir
- directory- Returns:
- parent directory
-
isRoot
public boolean isRoot(java.io.File f)
Returns true if the given file object is root.- Overrides:
isRoot
in classjavax.swing.filechooser.FileSystemView
- Parameters:
f
- file object to check if root- Returns:
- boolean value if file object is root (true) or not (false)
-
-