TrueZIP File* 7.0

de.schlichtherle.truezip.file.swing
Class TFileSystemView

java.lang.Object
  extended by javax.swing.filechooser.FileSystemView
      extended by de.schlichtherle.truezip.file.swing.TDecoratingFileSystemView
          extended by de.schlichtherle.truezip.file.swing.TFileSystemView

@DefaultAnnotation(value=edu.umd.cs.findbugs.annotations.NonNull.class)
public class TFileSystemView
extends TDecoratingFileSystemView

A custom file system view required to browse archive files like (virtual) directories with a JFileChooser. This class is used by TFileTreeCellRenderer to render files and directories in a TFileTree.

Author:
Christian Schlichtherle

Field Summary
private  TArchiveDetector archiveDetector
          Maybe null - uses default then.
 
Fields inherited from class de.schlichtherle.truezip.file.swing.TDecoratingFileSystemView
delegate
 
Constructor Summary
TFileSystemView()
           
TFileSystemView(FileSystemView fileSystemView)
           
TFileSystemView(FileSystemView fileSystemView, TArchiveDetector archiveDetector)
           
 
Method Summary
 File createFileObject(File file)
          Creates a ZIP enabled file where necessary only, otherwise the file 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)
           
 TArchiveDetector getArchiveDetector()
          Returns the archive detector to use.
 File getChild(File parent, String child)
           
 File[] getFiles(File dir, boolean useFileHiding)
           
 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(TArchiveDetector archiveDetector)
          Sets the archive detector to use.
protected  File unwrap(File file)
          Ensures that the returned file object is an instance of File, not TFile.
protected  TFile wrap(File file)
          Ensures that the returned file object is an instance of TFile.
 
Methods inherited from class de.schlichtherle.truezip.file.swing.TDecoratingFileSystemView
createFileSystemRoot, getDefaultDirectory, getHomeDirectory, getRoots, toString
 
Methods inherited from class javax.swing.filechooser.FileSystemView
getFileSystemView
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

archiveDetector

@CheckForNull
private TArchiveDetector archiveDetector
Maybe null - uses default then.

Constructor Detail

TFileSystemView

public TFileSystemView()

TFileSystemView

public TFileSystemView(FileSystemView fileSystemView)

TFileSystemView

public TFileSystemView(FileSystemView fileSystemView,
                       @CheckForNull
                       TArchiveDetector archiveDetector)
Method Detail

getArchiveDetector

@CheckForNull
public TArchiveDetector getArchiveDetector()
Returns the archive detector to use.


setArchiveDetector

public void setArchiveDetector(@CheckForNull
                               TArchiveDetector archiveDetector)
Sets the archive detector to use.

Parameters:
archiveDetector - the archive detector to use.

wrap

protected TFile wrap(File file)
Ensures that the returned file object is an instance of TFile.


unwrap

protected File unwrap(File file)
Ensures that the returned file object is an instance of File, not TFile.


isRoot

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

isTraversable

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

getSystemDisplayName

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

getSystemTypeDescription

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

getSystemIcon

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

isParent

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

getChild

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

isFileSystem

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

createNewFolder

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

isHiddenFile

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

isFileSystemRoot

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

isDrive

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

isFloppyDrive

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

isComputerNode

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

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 TDecoratingFileSystemView

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 TDecoratingFileSystemView

createFileObject

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


getFiles

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

getParentDirectory

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

TrueZIP File* 7.0

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