Class ExtensionFilter

java.lang.Object
  extended by javax.swing.filechooser.FileFilter
      extended by ExtensionFilter

public class ExtensionFilter
extends javax.swing.filechooser.FileFilter

Extension Filter Class

Set-up an extension filter for files, when prompted with "Save" dialogs.

The Boolean variable "VERBOSE_DEBUG" displays debugging information for this class. Set value to "true" to display messages.

Version:
0.3 - Initial Release
Author:
Richard John Sproston [ richard.sproston@gmail.com || lucky_jackpot@hotmail.com ]

Constructor Summary
ExtensionFilter()
          Default Constructor for class, with no parameters.
ExtensionFilter(java.lang.String ext, java.lang.String desc)
          Default Constructor for class, with 2 parameters.
 
Method Summary
 boolean accept(java.io.File file)
          This method returns a boolean value, depending on whether the "file" is successfully accepted by the application as being of the correct data-type.
 java.lang.String getDescription()
          This method returns the String description for use in manipulating the constructor's value for this variable.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ExtensionFilter

public ExtensionFilter()
Default Constructor for class, with no parameters.


ExtensionFilter

public ExtensionFilter(java.lang.String ext,
                       java.lang.String desc)
Default Constructor for class, with 2 parameters.

Parameters:
ext - This is used to set a String data-type as a FileFilter extension.
desc - This is used to provide a String description of the file extension.
Method Detail

accept

public boolean accept(java.io.File file)
This method returns a boolean value, depending on whether the "file" is successfully accepted by the application as being of the correct data-type.

Specified by:
accept in class javax.swing.filechooser.FileFilter
Parameters:
file - The File object to be checked for a comparison.
Returns:
The boolean value returned, depending on whether the "file" to be accepted is a directory or whether the file ends with the appropriate extension.

getDescription

public java.lang.String getDescription()
This method returns the String description for use in manipulating the constructor's value for this variable.

Specified by:
getDescription in class javax.swing.filechooser.FileFilter
Returns:
The String value/content of the variable, for manipulation in the class's constructor (2 params).