projectviewer.importer
Class GlobFilter

java.lang.Object
  extended by projectviewer.importer.ImporterFileFilter
      extended by projectviewer.importer.GlobFilter
All Implemented Interfaces:
org.gjt.sp.jedit.io.VFSFileFilter

public final 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
Author:
Marcelo Vanzin

Field Summary
 
Fields inherited from interface org.gjt.sp.jedit.io.VFSFileFilter
SERVICE_NAME
 
Constructor Summary
GlobFilter(java.lang.String fileGlobs, java.lang.String dirGlobs)
          Creates a new GlobFilter based on the given parameters.
 
Method Summary
 boolean accept(org.gjt.sp.jedit.io.VFSFile file)
           
protected  void done()
          Called by project viewer after the filter is used for importing.
 java.lang.String getDescription()
           
 java.lang.String getDirectoryGlobs()
          Returns the "ignore directories" globs for this filter.
 java.lang.String getFileGlobs()
          Returns the "include file" globs for this filter.
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.
 boolean isCustom()
          Tells whether this instance is a customized filter or a "built-in" one.
 
Methods inherited from class projectviewer.importer.ImporterFileFilter
accept, getId, 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.
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(org.gjt.sp.jedit.io.VFSFile 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. For example, "Import all files." or "Use the CVS/Entries file."

Specified by:
getRecurseDescription in class ImporterFileFilter

isCustom

public boolean isCustom()
Tells whether this instance is a customized filter or a "built-in" one.


getFileGlobs

public java.lang.String getFileGlobs()
Returns the "include file" globs for this filter.


getDirectoryGlobs

public java.lang.String getDirectoryGlobs()
Returns the "ignore directories" globs for this filter.


done

protected void done()
Description copied from class: ImporterFileFilter
Called by project viewer after the filter is used for importing. Filters that cache data should override this method and clean up any caches so that future imports are unaffected by the state.

Overrides:
done in class ImporterFileFilter