org.jfree.ui

Class FilesystemFilter

Implemented Interfaces:
FilenameFilter

public class FilesystemFilter
extends FileFilter
implements FilenameFilter

A filesystem filter.
Author:
David Gilbert

Constructor Summary

FilesystemFilter(String fileext, String descr)
Creates a new filter.
FilesystemFilter(String fileext, String descr, boolean accDirs)
Creates a new filter.
FilesystemFilter(String[] fileext, String descr, boolean accDirs)
Creates a new filter.

Method Summary

boolean
accept(File dir)
Returns true if the specified file matches the requirements of this filter, and false otherwise.
boolean
accept(File dir, String name)
Returns true if the file is accepted, and false otherwise.
void
acceptDirectories(boolean b)
Sets the flag that controls whether or not the filter accepts directories.
boolean
acceptsDirectories()
Returns the flag that indicates whether or not the filter accepts directories.
String
getDescription()
Returns the filter description.

Constructor Details

FilesystemFilter

public FilesystemFilter(String fileext,
                        String descr)
Creates a new filter.
Parameters:
fileext - the file extension.
descr - the description.

FilesystemFilter

public FilesystemFilter(String fileext,
                        String descr,
                        boolean accDirs)
Creates a new filter.
Parameters:
fileext - the file extension.
descr - the description.
accDirs - accept directories?

FilesystemFilter

public FilesystemFilter(String[] fileext,
                        String descr,
                        boolean accDirs)
Creates a new filter.
Parameters:
fileext - the file extension.
descr - the description.
accDirs - accept directories?

Method Details

accept

public boolean accept(File dir)
Returns true if the specified file matches the requirements of this filter, and false otherwise.
Parameters:
dir - the file or directory.
Returns:
A boolean.

accept

public boolean accept(File dir,
                      String name)
Returns true if the file is accepted, and false otherwise.
Parameters:
dir - the directory.
name - the file name.
Returns:
A boolean.

acceptDirectories

public void acceptDirectories(boolean b)
Sets the flag that controls whether or not the filter accepts directories.
Parameters:
b - a boolean.

acceptsDirectories

public boolean acceptsDirectories()
Returns the flag that indicates whether or not the filter accepts directories.
Returns:
A boolean.

getDescription

public String getDescription()
Returns the filter description.
Returns:
The filter description.