Class ExtensionFileFilter

  extended by javax.swing.filechooser.FileFilter
      extended by com.jrefinery.ui.ExtensionFileFilter

public class ExtensionFileFilter
extends javax.swing.filechooser.FileFilter

A filter for JFileChooser that filters files by extension.

Constructor Summary
ExtensionFileFilter(java.lang.String description, java.lang.String extension)
          Standard constructor.
Method Summary
 boolean accept( file)
          Returns true if the file ends with the specified extension.
 java.lang.String getDescription()
          Returns the description of the filter.
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail


public ExtensionFileFilter(java.lang.String description,
                           java.lang.String extension)
Standard constructor.

description - A description of the file type;
extension - The file extension;
Method Detail


public boolean accept( file)
Returns true if the file ends with the specified extension.

Specified by:
accept in class javax.swing.filechooser.FileFilter
file - The file to test;
A boolean that indicates whether or not the file is accepted by the filter;


public java.lang.String getDescription()
Returns the description of the filter.

Specified by:
getDescription in class javax.swing.filechooser.FileFilter
A description of the filter;

Copyright © 2003 MBARI.

The Monterey Bay Aquarium Research Institute (MBARI) provides this documentation and code "as is", with no warranty, express or implied, of its quality or consistency. It is provided without support and without obligation on the part of MBARI to assist in its use, correction, modification, or enhancement.