fcmodeler.io
Class AbstractFileFilter

java.lang.Object
  |
  +--javax.swing.filechooser.FileFilter
        |
        +--fcmodeler.io.AbstractFileFilter
Direct Known Subclasses:
JPEGFileFilter, PostscriptFileFilter, RankClusterDotFileFilter, SimpleDotFileFilter, XMLFileFilter

public abstract class AbstractFileFilter
extends javax.swing.filechooser.FileFilter

An abstract convenience class for file filters. Concrete subclasses representing file filters for certain file types simply subclass this class, override the isValidExtension method, and create a string description of the file type.

Since:
JDK1.3
Version:
$Revision: 1.7 $
Author:
Zach Cox

Field Summary
protected  java.lang.String _description
          The string description for this file filter.
 
Constructor Summary
AbstractFileFilter()
          Creates a new AbstractFileFilter.
 
Method Summary
 boolean accept(java.io.File file)
          Returns true if the specified file should be shown in the file chooser.
 java.lang.String getDescription()
          Returns the string description of this file filter.
abstract  boolean isValidExtension(java.lang.String extension)
          Returns true if the specified file extension is valid for this file filter.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

_description

protected java.lang.String _description
The string description for this file filter.
Constructor Detail

AbstractFileFilter

public AbstractFileFilter()
Creates a new AbstractFileFilter.
Method Detail

accept

public boolean accept(java.io.File file)
Returns true if the specified file should be shown in the file chooser.
Overrides:
accept in class javax.swing.filechooser.FileFilter
Parameters:
file - the file to test for acceptance.
Returns:
true if the specified file should be shown in the file chooser.

getDescription

public java.lang.String getDescription()
Returns the string description of this file filter.
Overrides:
getDescription in class javax.swing.filechooser.FileFilter
Returns:
the string description of this file filter.

isValidExtension

public abstract boolean isValidExtension(java.lang.String extension)
Returns true if the specified file extension is valid for this file filter.
Parameters:
extension - the file extension to test for validity.
Returns:
true if the specified file extension is valid for this file filter.