us.zuercher.gpx2map.gui
Class Main.LocalFileFilter

java.lang.Object
  extended by javax.swing.filechooser.FileFilter
      extended by us.zuercher.gpx2map.gui.Main.LocalFileFilter
Enclosing class:
Main

private static class Main.LocalFileFilter
extends FileFilter

LocalFileFilter is a FileFilter for a JFileChooser.


Field Summary
private  String desc
           
private  Collection<String> suffixes
           
 
Constructor Summary
private Main.LocalFileFilter(String desc, Collection<String> suffixes)
          Construct a new LocalFileFilter with the given description and suffixes.
 
Method Summary
 boolean accept(File f)
          Tests whether the given file should be displayed in the chooser.
 String getDescription()
          Returns the description of this filter.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

desc

private final String desc

suffixes

private final Collection<String> suffixes
Constructor Detail

Main.LocalFileFilter

private Main.LocalFileFilter(String desc,
                             Collection<String> suffixes)
Construct a new LocalFileFilter with the given description and suffixes.

Parameters:
desc - filter description (e.g. "JPEG Files")
suffixes - case insensitive suffixes (e.g. ".jpeg", ".jpg")
Method Detail

accept

public boolean accept(File f)
Tests whether the given file should be displayed in the chooser. Ignores paths that start with with a period. Otherwise accepts all directories and any file that ends with one of the given suffixes.

Specified by:
accept in class FileFilter
Parameters:
f - path to test for acceptance
Returns:
true if the file passes the test, false otherwise

getDescription

public String getDescription()
Returns the description of this filter.

Specified by:
getDescription in class FileFilter
Returns:
the description of this filter.