anecho.util
Class SimpleFilter

java.lang.Object
  extended by javax.swing.filechooser.FileFilter
      extended by anecho.util.SimpleFilter

public class SimpleFilter
extends javax.swing.filechooser.FileFilter

SimpleFilter is a class used to create simple file filters for use with a JFileChooser


Constructor Summary
SimpleFilter()
           
 
Method Summary
 boolean accept(java.io.File checkFile)
          This method determines if a file or directory should be shown by the filter.
 void acceptDirs(boolean accept)
          Returns a boolean value
 java.lang.String getDescription()
          Returns the human-readable description of this filter.
 void setDescription(java.lang.String desc)
          Set the human-readable description for this filter.
 void setFilters(java.lang.String[] filts)
          This method sets the different filters.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SimpleFilter

public SimpleFilter()
Method Detail

accept

public boolean accept(java.io.File checkFile)
This method determines if a file or directory should be shown by the filter.

Specified by:
accept in class javax.swing.filechooser.FileFilter
Parameters:
checkFile - The file to be checked
Returns:
true - this file or directory should be shown false - this file or directory should not be shown

getDescription

public java.lang.String getDescription()
Returns the human-readable description of this filter.

Specified by:
getDescription in class javax.swing.filechooser.FileFilter
Returns:
Returns a human-readable description of this filter.

setDescription

public void setDescription(java.lang.String desc)
Set the human-readable description for this filter.

Parameters:
desc - Description of the filter.

setFilters

public void setFilters(java.lang.String[] filts)
This method sets the different filters.

Parameters:
filts - An array of strings representing the filters (eg. .jpg, .tif, .tiff, .html).

acceptDirs

public void acceptDirs(boolean accept)
Returns a boolean value

Parameters:
accept - true - accept directories false - do not accept directories