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 FileFilter
A filter for JFileChooser that filters files by extension.
  • Field Details

    • description

      private String description
      A description for the file type.
    • extension

      private String extension
      The extension (for example, "png" for *.png files).
  • Constructor Details

    • ExtensionFileFilter

      public ExtensionFileFilter(String description, String extension)
      Standard constructor.
      Parameters:
      description - a description of the file type;
      extension - the file extension;
  • Method Details

    • accept

      public boolean accept(File file)
      Returns true if the file ends with the specified extension.
      Specified by:
      accept in class FileFilter
      Parameters:
      file - the file to test.
      Returns:
      A boolean that indicates whether or not the file is accepted by the filter.
    • getDescription

      public String getDescription()
      Returns the description of the filter.
      Specified by:
      getDescription in class FileFilter
      Returns:
      a description of the filter.