TrueZIP 6.8.2

de.schlichtherle.io.swing
Class FileSystemView

java.lang.Object
  extended by javax.swing.filechooser.FileSystemView
      extended by de.schlichtherle.io.swing.FilterFileSystemView
          extended by de.schlichtherle.io.swing.FileSystemView

public class FileSystemView
extends FilterFileSystemView

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.

Version:
$Id: FileSystemView.java 06f3ba684701 2010/11/04 01:15:55 christian $
Author:
Christian Schlichtherle

Field Summary
private  ArchiveDetector archiveDetector
          Maybe null - uses default then.
private static FileSystemView defaultView
           
 
Constructor Summary
private FileSystemView(FileSystemView delegate, ArchiveDetector archiveDetector)
           
 
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.
 File createNewFolder(File parent)
           
 ArchiveDetector getArchiveDetector()
          Returns a valid archive detector to use with this class.
 File getChild(File parent, String child)
           
 File[] getFiles(File dir, boolean useFileHiding)
           
static FileSystemView getFileSystemView()
           
static FileSystemView getFileSystemView(ArchiveDetector archiveDetector)
           
 File getParentDirectory(File file)
           
 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.
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 de.schlichtherle.io.swing.FilterFileSystemView
createFileSystemRoot, createFileSystemRootImpl, getDefaultDirectory, getDelegate, getHomeDirectory, getRoots, setDelegate
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

defaultView

private static FileSystemView defaultView

archiveDetector

private ArchiveDetector archiveDetector
Maybe null - uses default then.

Constructor Detail

FileSystemView

private FileSystemView(FileSystemView delegate,
                       ArchiveDetector archiveDetector)
Method Detail

getFileSystemView

public static final FileSystemView getFileSystemView()

getFileSystemView

public static final FileSystemView getFileSystemView(ArchiveDetector archiveDetector)

getArchiveDetector

public ArchiveDetector getArchiveDetector()
Returns a valid archive detector to use with this class. If no archive detector has been explicitly set for this file system view or the archive detector has been set to null, then File.getDefaultArchiveDetector() is returned.


setArchiveDetector

public void setArchiveDetector(ArchiveDetector archiveDetector)
Sets the archive detector to use within this class.

Parameters:
archiveDetector - The archive detector to use. May be null to indicate that File.getDefaultArchiveDetector() should be used.

wrap

protected File wrap(File file)
Wraps the given file in an archive enabled file.


unwrap

protected File unwrap(File file)
Unwraps the delegate of a possibly archive enabled file.


createFileObject

public File createFileObject(File file)
Creates a ZIP enabled file where necessary only, otherwise the blueprint is simply returned.


isRoot

public boolean isRoot(File file)
Overrides:
isRoot in class FilterFileSystemView

isTraversable

public Boolean isTraversable(File file)
Overrides:
isTraversable in class FilterFileSystemView

getSystemDisplayName

public String getSystemDisplayName(File file)
Overrides:
getSystemDisplayName in class FilterFileSystemView

getSystemTypeDescription

public String getSystemTypeDescription(File file)
Overrides:
getSystemTypeDescription in class FilterFileSystemView

getSystemIcon

public Icon getSystemIcon(File file)
Overrides:
getSystemIcon in class FilterFileSystemView

isParent

public boolean isParent(File folder,
                        File file)
Overrides:
isParent in class FilterFileSystemView

getChild

public File getChild(File parent,
                     String child)
Overrides:
getChild in class FilterFileSystemView

isFileSystem

public boolean isFileSystem(File file)
Overrides:
isFileSystem in class FilterFileSystemView

createNewFolder

public File createNewFolder(File parent)
                     throws IOException
Overrides:
createNewFolder in class FilterFileSystemView
Throws:
IOException

isHiddenFile

public boolean isHiddenFile(File file)
Overrides:
isHiddenFile in class FilterFileSystemView

isFileSystemRoot

public boolean isFileSystemRoot(File file)
Overrides:
isFileSystemRoot in class FilterFileSystemView

isDrive

public boolean isDrive(File file)
Overrides:
isDrive in class FilterFileSystemView

isFloppyDrive

public boolean isFloppyDrive(File file)
Overrides:
isFloppyDrive in class FilterFileSystemView

isComputerNode

public boolean isComputerNode(File file)
Overrides:
isComputerNode in class FilterFileSystemView

createFileObject

public 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.

Overrides:
createFileObject in class FilterFileSystemView

createFileObject

public File createFileObject(String str)
Creates a ZIP enabled file where necessary only, otherwise the file system view delegate is used to create the file.

Overrides:
createFileObject in class FilterFileSystemView

getFiles

public File[] getFiles(File dir,
                       boolean useFileHiding)
Overrides:
getFiles in class FilterFileSystemView

getParentDirectory

public File getParentDirectory(File file)
Overrides:
getParentDirectory in class FilterFileSystemView

TrueZIP 6.8.2

Copyright © 2005-2011 Schlichtherle IT Services. All Rights Reserved.