com.jrefinery.ui
Class ExtensionFileFilter

java.lang.Object
  |
  +--javax.swing.filechooser.FileFilter
        |
        +--com.jrefinery.ui.ExtensionFileFilter

public class ExtensionFileFilter
extends javax.swing.filechooser.FileFilter

A filter for JFileChooser that filters files by extension.

Author:
DG

Constructor Summary
ExtensionFileFilter(java.lang.String description, java.lang.String extension)
          Standard constructor.
 
Method Summary
 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.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ExtensionFileFilter

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

accept

public boolean accept(java.io.File file)
Returns true if the file ends with the specified extension.
Overrides:
accept in class javax.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.
Overrides:
getDescription in class javax.swing.filechooser.FileFilter
Returns:
a description of the filter.