All Packages  Class Hierarchy  This Package  Previous  Next  Index  WEKA's home

Class weka.gui.ExtensionFileFilter

java.lang.Object
    |
    +----javax.swing.filechooser.FileFilter
            |
            +----weka.gui.ExtensionFileFilter

public class ExtensionFileFilter
extends javax.swing.filechooser.FileFilter
implements java.io.FilenameFilter
Provides a file filter for FileChoosers that accepts or rejects files based on their extension. Compatible with both java.io.FilenameFilter and javax.swing.filechooser.FileFilter (why there are two I have no idea).

Version:
$Revision: 1.3 $
Author:
Len Trigg (trigg@cs.waikato.ac.nz)

Constructor Index

 o ExtensionFileFilter(String, String)
Creates the ExtensionFileFilter

Method Index

 o accept(File)
Returns true if the supplied file should be accepted (i.e.
 o accept(File, String)
Returns true if the file in the given directory with the given name should be accepted.
 o getDescription()
Gets the description of accepted files.

Constructor Detail

 o ExtensionFileFilter
public ExtensionFileFilter(java.lang.String extension,
                           java.lang.String description)
          Creates the ExtensionFileFilter
Parameters:
extension - the extension of accepted files.
description - a text description of accepted files.

Method Detail

 o getDescription
public java.lang.String getDescription()
          Gets the description of accepted files.
Returns:
the description.
Overrides:
getDescription in class javax.swing.filechooser.FileFilter
 o accept
public boolean accept(java.io.File file)
          Returns true if the supplied file should be accepted (i.e. if it has the required extension or is a directory).
Parameters:
file - the file of interest.
Returns:
true if the file is accepted by the filter.
Overrides:
accept in class javax.swing.filechooser.FileFilter
 o accept
public boolean accept(java.io.File dir,
                      java.lang.String name)
          Returns true if the file in the given directory with the given name should be accepted.
Parameters:
dir - the directory where the file resides.
name - the name of the file.
Returns:
true if the file is accepted.

All Packages  Class Hierarchy  This Package  Previous  Next  Index  WEKA's home