us.zuercher.gpx2map.gui
Class Main.LocalFileFilter
java.lang.Object
javax.swing.filechooser.FileFilter
us.zuercher.gpx2map.gui.Main.LocalFileFilter
- Enclosing class:
- Main
private static class Main.LocalFileFilter
- extends FileFilter
LocalFileFilter is a FileFilter
for a JFileChooser
.
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 |
desc
private final String desc
suffixes
private final Collection<String> suffixes
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")
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.