TrueZIP 6.8.3

de.schlichtherle.io.swing
Class FileView

java.lang.Object
  extended by javax.swing.filechooser.FileView
      extended by de.schlichtherle.io.swing.FilterFileView
          extended by de.schlichtherle.io.swing.FileView

final class FileView
extends FilterFileView

An archive enabled file view. This class recognizes instances of the File 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 File.isDirectory() or similar unless really necessary. This is to prevent dead locks between the Event Dispatch Thread and the Basic L&F File Loading Threads which are forked by JFileChooser.

Author:
Christian Schlichtherle

Field Summary
private static String CLASS_NAME
           
private static ResourceBundle resources
           
 
Constructor Summary
FileView(FileView delegate)
          Creates a new archive enabled file view.
 
Method Summary
(package private) static Icon closedIcon(File file)
           
private static File createNonArchiveFile(File file)
           
 Icon getIcon(File file)
           
 String getTypeDescription(File file)
           
private static Icon icon(File file)
           
private static boolean isEntryInValidArchive(File file)
           
 Boolean isTraversable(File file)
           
private static boolean isValidArchive(File file)
           
(package private) static Icon openIcon(File file)
           
(package private) static Boolean traversable(File file)
           
(package private) static String typeDescription(File file)
           
 
Methods inherited from class de.schlichtherle.io.swing.FilterFileView
getDelegate, getDescription, getName, setDelegate
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

CLASS_NAME

private static final String CLASS_NAME
See Also:
Constant Field Values

resources

private static final ResourceBundle resources
Constructor Detail

FileView

public FileView(FileView delegate)
Creates a new archive enabled file view.

Parameters:
delegate - The file view to be decorated - may be null.
Method Detail

getIcon

public Icon getIcon(File file)
Overrides:
getIcon in class FilterFileView

getTypeDescription

public String getTypeDescription(File file)
Overrides:
getTypeDescription in class FilterFileView

isTraversable

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

openIcon

static Icon openIcon(File file)

closedIcon

static Icon closedIcon(File file)

icon

private static Icon icon(File file)

typeDescription

static String typeDescription(File file)

isValidArchive

private static boolean isValidArchive(File file)

createNonArchiveFile

private static File createNonArchiveFile(File file)

isEntryInValidArchive

private static boolean isEntryInValidArchive(File file)

traversable

static Boolean traversable(File file)

TrueZIP 6.8.3

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