javatools.swing
Class SimpleFileFilter

java.lang.Object
  |
  +--javax.swing.filechooser.FileFilter
        |
        +--javatools.swing.SimpleFileFilter
All Implemented Interfaces:
java.io.FileFilter

public class SimpleFileFilter
extends javax.swing.filechooser.FileFilter
implements java.io.FileFilter

It's an implementation of the file filter, accepting a set of extensions.


Constructor Summary
SimpleFileFilter(java.lang.String ext)
          Creates a new SimpleFileFilter, with default description.
SimpleFileFilter(java.lang.String[] exts, java.lang.String descr)
          Creates a new SimpleFileFilter, with an array of extensions and a description.
SimpleFileFilter(java.lang.String ext, java.lang.String descr)
          Creates a new SimpleFileFilter, with one extension and a description.
 
Method Summary
 boolean accept(java.io.File f)
          Checks if a certain file should be accepted or not.
 java.lang.String getDescription()
          Returns the description for this filter.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SimpleFileFilter

public SimpleFileFilter(java.lang.String ext)
Creates a new SimpleFileFilter, with default description.

Parameters:
ext - The requested extension.

SimpleFileFilter

public SimpleFileFilter(java.lang.String ext,
                        java.lang.String descr)
Creates a new SimpleFileFilter, with one extension and a description.

Parameters:
ext - The requested extension.
descr - The description of the extension.

SimpleFileFilter

public SimpleFileFilter(java.lang.String[] exts,
                        java.lang.String descr)
Creates a new SimpleFileFilter, with an array of extensions and a description.

Parameters:
exts - The extension to use.
descr - The description of these extension.
Method Detail

getDescription

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

Specified by:
getDescription in class javax.swing.filechooser.FileFilter
Returns:
The requested description.

accept

public boolean accept(java.io.File f)
Checks if a certain file should be accepted or not.

Specified by:
accept in interface java.io.FileFilter
Specified by:
accept in class javax.swing.filechooser.FileFilter
Parameters:
f - The file to check.
Returns:
true: the file is accepted; false: the file is NOT accepted.