org.ejtools.util
Class FileTools.SimpleFileFilter

java.lang.Object
  |
  +--javax.swing.filechooser.FileFilter
        |
        +--org.ejtools.util.FileTools.SimpleFileFilter
Enclosing class:
FileTools

protected static class FileTools.SimpleFileFilter
extends javax.swing.filechooser.FileFilter

An helper class that simplifies the creation of a FileFilter.

Version:
$Revision: 1.2 $
Author:
Laurent Etiemble

Constructor Summary
FileTools.SimpleFileFilter(java.lang.String extension, java.lang.String description)
          Constructor for SimpleFileFilter class
 
Method Summary
 boolean accept(java.io.File file)
          Check wheter or not the file ends with the right extension.
 java.lang.String getDescription()
          Returns the description string for displaying inside the JFileChooser
 java.lang.String getExtension()
          Gets the extension attribute of the SimpleFileFilter object
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FileTools.SimpleFileFilter

public FileTools.SimpleFileFilter(java.lang.String extension,
                                  java.lang.String description)
Constructor for SimpleFileFilter class

Parameters:
extension - The file extension. Must start with a dot.
description - The description that will appears in the JFileChooser
Method Detail

accept

public boolean accept(java.io.File file)
Check wheter or not the file ends with the right extension.

Specified by:
accept in class javax.swing.filechooser.FileFilter
Parameters:
file - The file to test
Returns:
True if the file is accepted

getDescription

public java.lang.String getDescription()
Returns the description string for displaying inside the JFileChooser

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

getExtension

public java.lang.String getExtension()
Gets the extension attribute of the SimpleFileFilter object

Returns:
The extension value


Copyright © 2002-2003 EJTools Org.. All Rights Reserved.