|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjavax.swing.filechooser.FileSystemView
de.schlichtherle.io.swing.FileSystemView
public class FileSystemView
A custom file system view required to browse archive files like (virtual)
directories with a JFileChooser.
This class is also used by
FileTreeCellRenderer
to render files and directories in a
JFileTree
.
Method Summary | |
---|---|
File |
createFileObject(File file)
Creates a ZIP enabled file where necessary only, otherwise the blueprint is simply returned. |
File |
createFileObject(File dir,
String str)
Creates a ZIP enabled file where necessary only, otherwise the file system view delegate is used to create the file. |
File |
createFileObject(String str)
Creates a ZIP enabled file where necessary only, otherwise the file system view delegate is used to create the file. |
protected File |
createFileSystemRoot(File f)
Forwards the call to createFileSystemRootImpl(java.io.File) . |
File |
createFileSystemRootImpl(File f)
Creates a new File object for f with correct
behavior for a file system root directory. |
File |
createNewFolder(File parent)
|
ArchiveDetector |
getArchiveDetector()
Returns a valid archive detector to use with this class. |
File |
getChild(File parent,
String child)
|
File |
getDefaultDirectory()
|
FileSystemView |
getDelegate()
Returns the file system view to be decorated - never null . |
File[] |
getFiles(File dir,
boolean useFileHiding)
|
static FileSystemView |
getFileSystemView()
|
static FileSystemView |
getFileSystemView(ArchiveDetector archiveDetector)
|
File |
getHomeDirectory()
|
File |
getParentDirectory(File file)
|
File[] |
getRoots()
|
String |
getSystemDisplayName(File file)
|
Icon |
getSystemIcon(File file)
|
String |
getSystemTypeDescription(File file)
|
boolean |
isComputerNode(File file)
|
boolean |
isDrive(File file)
|
boolean |
isFileSystem(File file)
|
boolean |
isFileSystemRoot(File file)
|
boolean |
isFloppyDrive(File file)
|
boolean |
isHiddenFile(File file)
|
boolean |
isParent(File folder,
File file)
|
boolean |
isRoot(File file)
|
Boolean |
isTraversable(File file)
|
void |
setArchiveDetector(ArchiveDetector archiveDetector)
Sets the archive detector to use within this class. |
void |
setDelegate(FileSystemView delegate)
Sets the file system view to be decorated. |
protected File |
unwrap(File file)
Unwraps the delegate of a possibly archive enabled file. |
protected File |
wrap(File file)
Wraps the given file in an archive enabled file. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
---|
public static final FileSystemView getFileSystemView()
public static final FileSystemView getFileSystemView(ArchiveDetector archiveDetector)
public ArchiveDetector getArchiveDetector()
null
,
then File.getDefaultArchiveDetector()
is
returned.
public void setArchiveDetector(ArchiveDetector archiveDetector)
archiveDetector
- The archive detector to use.
May be null
to indicate that
File.getDefaultArchiveDetector()
should be used.protected File wrap(File file)
protected File unwrap(File file)
public File createFileObject(File file)
public boolean isRoot(File file)
public Boolean isTraversable(File file)
public String getSystemDisplayName(File file)
public String getSystemTypeDescription(File file)
public Icon getSystemIcon(File file)
public boolean isParent(File folder, File file)
public File getChild(File parent, String child)
public boolean isFileSystem(File file)
public File createNewFolder(File parent) throws IOException
IOException
public boolean isHiddenFile(File file)
public boolean isFileSystemRoot(File file)
public boolean isDrive(File file)
public boolean isFloppyDrive(File file)
public boolean isComputerNode(File file)
public File createFileObject(File dir, String str)
public File createFileObject(String str)
public File[] getFiles(File dir, boolean useFileHiding)
public File getParentDirectory(File file)
public FileSystemView getDelegate()
null
.
public void setDelegate(FileSystemView delegate)
NullPointerException
- If delegate
is null
.
IllegalArgumentException
- If delegate
is this
instance.public File[] getRoots()
getRoots
in class FileSystemView
public File getHomeDirectory()
getHomeDirectory
in class FileSystemView
public File getDefaultDirectory()
getDefaultDirectory
in class FileSystemView
protected final File createFileSystemRoot(File f)
createFileSystemRootImpl(java.io.File)
.
createFileSystemRoot
in class FileSystemView
public File createFileSystemRootImpl(File f)
File
object for f
with correct
behavior for a file system root directory.
If the delegate is an instance of this class, then this method
forwards the call to the delegate like all other methods in this class.
Otherwise, the super class implementation of the method
FileSystemView.createFileSystemRoot(java.io.File)
is called.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |