Package org.jfree.ui
Class ExtensionFileFilter
- java.lang.Object
-
- javax.swing.filechooser.FileFilter
-
- org.jfree.ui.ExtensionFileFilter
-
- Direct Known Subclasses:
JavaSourceCollector.CollectorFileFilter
public class ExtensionFileFilter extends javax.swing.filechooser.FileFilter
A filter for JFileChooser that filters files by extension.
-
-
Field Summary
Fields Modifier and Type Field Description private java.lang.String
description
A description for the file type.private java.lang.String
extension
The extension (for example, "png" for *.png files).
-
Constructor Summary
Constructors Constructor Description ExtensionFileFilter(java.lang.String description, java.lang.String extension)
Standard constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
accept(java.io.File file)
Returns true if the file ends with the specified extension.java.lang.String
getDescription()
Returns the description of the filter.
-
-
-
Method Detail
-
accept
public boolean accept(java.io.File file)
Returns true if the file ends with the specified extension.- Specified by:
accept
in classjavax.swing.filechooser.FileFilter
- Parameters:
file
- the file to test.- Returns:
- A boolean that indicates whether or not the file is accepted by the filter.
-
getDescription
public java.lang.String getDescription()
Returns the description of the filter.- Specified by:
getDescription
in classjavax.swing.filechooser.FileFilter
- Returns:
- a description of the filter.
-
-