projectviewer.importer
Class CVSEntriesFilter

java.lang.Object
  extended byjavax.swing.filechooser.FileFilter
      extended byprojectviewer.importer.ImporterFileFilter
          extended byprojectviewer.importer.CVSEntriesFilter
All Implemented Interfaces:
java.io.FilenameFilter

public class CVSEntriesFilter
extends ImporterFileFilter

Filter that uses the CVS/Entries file to decide if a file should be accepted or not. The filter behaves a little differently depending on where it's being used: if inside a JFileChooser, it accepts directories regardless of them being on the CVS/Entries file or not, so the user can navigate freely.

For the java.io.FilenameFilter implementation, the CVS/Entries listing is strictly enforced, even for directories. This way, no directories that are not listed there are going to be imported into the project.

"Entries" files read are kept in an internal cache so that subsequent visits to the same directory are faster.

Since PV 2.1.1, this filter also looks for .svn/entries files when they're available.

Version:
$Id: CVSEntriesFilter.java 7149 2006-09-30 06:14:20Z ezust $
Author:
Marcelo Vanzin

Constructor Summary
CVSEntriesFilter()
           
 
Method Summary
 boolean accept(java.io.File file)
          accept() method for the Swing JFileChooser.
 boolean accept(java.io.File file, java.lang.String fileName)
          accept() method for the FilenameFilter implementation.
 java.lang.String getDescription()
           
 java.lang.String getRecurseDescription()
          This method will be called by the toString() method when showing this filter as an option to the dialog shown when asking about whether the user wants to recurse into the directories selected for importing.
 
Methods inherited from class projectviewer.importer.ImporterFileFilter
toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

CVSEntriesFilter

public CVSEntriesFilter()
Method Detail

getDescription

public java.lang.String getDescription()

accept

public boolean accept(java.io.File file)
accept() method for the Swing JFileChooser. Accepts files only if they are in the CVS/Entries file for the directory. All directories not named "CVS" are accepted, so the user can navigate freely.


accept

public boolean accept(java.io.File file,
                      java.lang.String fileName)
accept() method for the FilenameFilter implementation. Accepts only files and directories that are listed in the CVS/Entries file.


getRecurseDescription

public java.lang.String getRecurseDescription()
Description copied from class: ImporterFileFilter
This method will be called by the toString() method when showing this filter as an option to the dialog shown when asking about whether the user wants to recurse into the directories selected for importing.

It should return a short, descriptive string of what the filter does, gererally prefixed with "Yes,". For example, "Yes, import all files." or "Yes, use the CVS/Entries file."

Specified by:
getRecurseDescription in class ImporterFileFilter