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