cdox.gui
Class ExtensionFilter

java.lang.Object
  extended byjavax.swing.filechooser.FileFilter
      extended bycdox.gui.ExtensionFilter

public class ExtensionFilter
extends javax.swing.filechooser.FileFilter

This class arranges the file extensions in the JFileChooser defined in CDoxFrame.

Version:
May 16th 2002
Author:
Rutger Bezema, Andreas Schmitz

Constructor Summary
ExtensionFilter(java.lang.String ext, java.lang.String desc, java.lang.String alt)
          The Constructor accepts two String (extension and description) which will be stored.
 
Method Summary
 boolean accept(java.io.File file)
          This Method returns true when the file is accepted by the extensionFilter.
 java.lang.String getAlternativeExtension()
          Returns the alternative extension.
 java.lang.String getDescription()
          This Method returns the extension's description.
 java.lang.String getExtension()
          Returns the extension.
 java.lang.String toString()
          Returns this class as the extensions it represents.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ExtensionFilter

public ExtensionFilter(java.lang.String ext,
                       java.lang.String desc,
                       java.lang.String alt)
The Constructor accepts two String (extension and description) which will be stored. The extension-String is converted to lowercase.

Parameters:
ext - is the extension
desc - is the file extension's description
alt - is an alternative filter (for example *.jpg && *.jpeg)
Method Detail

accept

public boolean accept(java.io.File file)
This Method returns true when the file is accepted by the extensionFilter. This Method must be overwritten from the abstract class FileFilter.

Parameters:
file - is the File to check.
Returns:
true if the file fits the profile of this ExtensionFilter false otherwhise.

getDescription

public java.lang.String getDescription()
This Method returns the extension's description.

Returns:
this filefilter description

getExtension

public java.lang.String getExtension()
Returns the extension.

Returns:
this fileFilter's extension.

getAlternativeExtension

public java.lang.String getAlternativeExtension()
Returns the alternative extension.

Returns:
this fileFilter's alternative extension.

toString

public java.lang.String toString()
Returns this class as the extensions it represents.

Returns:
the extension