projectviewer.importer
Class GlobFilter

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

public class GlobFilter
extends ImporterFileFilter

Filter that uses the settings provided by the user (in jEdit's options) to select the files.

Since:
PV 2.1.1
Version:
$Id: GlobFilter.java 6410 2006-06-12 01:53:11Z vanza $
Author:
Marcelo Vanzin

Constructor Summary
GlobFilter(java.lang.String fileGlobs, java.lang.String dirGlobs)
          Creates a new GlobFilter based on the given parameters.
GlobFilter(java.lang.String description, java.lang.String recurseDescription, java.lang.String fileGlobs, java.lang.String dirGlobs)
          Creates a new GlobFilter based on the given parameters with some description texts.
 
Method Summary
 boolean accept(java.io.File file)
           
 boolean accept(java.io.File dir, java.lang.String fileName)
           
 java.lang.String getDescription()
           
static GlobFilter getImportSettingsFilter()
          Returns a glob filter with the settings taken from the global ProjectViewer "import settings".
 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

GlobFilter

public GlobFilter(java.lang.String fileGlobs,
                  java.lang.String dirGlobs)
Creates a new GlobFilter based on the given parameters.

Parameters:
fileGlobs - List of globs of files to accept (or reject if the glob starts with !). space-separated.
dirGlobs - List of globs of directory names to ignore.

GlobFilter

public GlobFilter(java.lang.String description,
                  java.lang.String recurseDescription,
                  java.lang.String fileGlobs,
                  java.lang.String dirGlobs)
Creates a new GlobFilter based on the given parameters with some description texts. Mainly used internally by PV for the import settings filter.

Method Detail

getImportSettingsFilter

public static GlobFilter getImportSettingsFilter()
Returns a glob filter with the settings taken from the global ProjectViewer "import settings".


getDescription

public java.lang.String getDescription()

accept

public boolean accept(java.io.File file)

accept

public boolean accept(java.io.File dir,
                      java.lang.String fileName)

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