TrueZIP File* 7.0

de.schlichtherle.truezip.file.swing
Class TFileView

java.lang.Object
  extended by javax.swing.filechooser.FileView
      extended by de.schlichtherle.truezip.file.swing.TDecoratingFileView
          extended by de.schlichtherle.truezip.file.swing.TFileView

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

An archive enabled file view. This class recognizes instances of the TFile class and returns custom icons and type descriptions if it's an archive file or an archive entry. Otherwise, the super class behaviour is used.

Note that this class accesses archive files lazily, i.e. it does not eagerly check the true status with TFile.isDirectory() or similar unless really necessary. This is to prevent dead locks between the Event Dispatch Thread and the Basic L&F TFile Loading Threads which are forked by JFileChooser.

Author:
Christian Schlichtherle

Field Summary
private static String CLASS_NAME
           
private static ResourceBundle resources
           
 
Fields inherited from class de.schlichtherle.truezip.file.swing.TDecoratingFileView
delegate
 
Constructor Summary
TFileView(FileView fileView)
          Creates a new archive enabled file view.
 
Method Summary
 Icon getIcon(File file)
           
 String getTypeDescription(File file)
           
(package private) static Icon icon(File file)
           
private static boolean isEntryInTrueArchive(TFile file)
           
 Boolean isTraversable(File file)
           
private static boolean isTrueArchive(TFile file)
           
private static TFile newNonArchiveFile(TFile file)
           
(package private) static String typeDescription(File file)
           
 
Methods inherited from class de.schlichtherle.truezip.file.swing.TDecoratingFileView
getDescription, getName, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

CLASS_NAME

private static final String CLASS_NAME

resources

private static final ResourceBundle resources
Constructor Detail

TFileView

public TFileView(@CheckForNull
                 FileView fileView)
Creates a new archive enabled file view.

Parameters:
fileView - The nullable file view to decorate.
Method Detail

getTypeDescription

@Nullable
public String getTypeDescription(File file)
Overrides:
getTypeDescription in class TDecoratingFileView

typeDescription

@Nullable
static String typeDescription(File file)

getIcon

@Nullable
public Icon getIcon(File file)
Overrides:
getIcon in class TDecoratingFileView

icon

@Nullable
static Icon icon(File file)

isTrueArchive

private static boolean isTrueArchive(TFile file)

newNonArchiveFile

private static TFile newNonArchiveFile(@NonNull
                                       TFile file)

isEntryInTrueArchive

private static boolean isEntryInTrueArchive(TFile file)

isTraversable

@Nullable
public Boolean isTraversable(File file)
Overrides:
isTraversable in class TDecoratingFileView

TrueZIP File* 7.0

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