org.ceryle.util
Class ExtensionFileFilter

java.lang.Object
  extended by javax.swing.filechooser.FileFilter
      extended by org.ceryle.util.ExtensionFileFilter
All Implemented Interfaces:
FileFilter

public class ExtensionFileFilter
extends FileFilter
implements FileFilter

ExtensionFileFilter extends FileFilter to allow a customizable set of file extensions through the filter.

Since:
JDK1.3
Author:
Murray Altheim
See Also:
FileFilter

Constructor Summary
ExtensionFileFilter(String[] extensions, boolean acceptDirectories)
          Constructor with String array and a boolean acceptDirectories.
ExtensionFileFilter(String extension, boolean acceptDirectories)
          Constructor with single String extension and a boolean acceptDirectories.
 
Method Summary
 boolean accept(File file)
          Accept directories (if acceptDirectories setting is 'true') or filtered File file matches.
 String getDescription()
          Return the description of this filter.
 void setDescription(String description)
          Sets the description of this filter to description.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ExtensionFileFilter

public ExtensionFileFilter(String extension,
                           boolean acceptDirectories)
Constructor with single String extension and a boolean acceptDirectories.


ExtensionFileFilter

public ExtensionFileFilter(String[] extensions,
                           boolean acceptDirectories)
Constructor with String array and a boolean acceptDirectories.

Method Detail

accept

public boolean accept(File file)
Accept directories (if acceptDirectories setting is 'true') or filtered File file matches.

Specified by:
accept in interface FileFilter
Specified by:
accept in class FileFilter

setDescription

public void setDescription(String description)
Sets the description of this filter to description.


getDescription

public String getDescription()
Return the description of this filter. This returns the default "Importable Files" unless the value has been changed.

Specified by:
getDescription in class FileFilter


The Ceryle Project. Copyright ©2001-2007 Murray Altheim, All Rights Reserved. See LICENSE included with distribution.