|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--javax.swing.filechooser.FileFilter | +--com.jrefinery.report.util.FilesystemFilter
A generic filesystem filter which implements FilenameFilter and the Swing FileFilter. Multiple extensions can be registered for a single filetype.
Constructor Summary | |
FilesystemFilter(java.lang.String[] fileext,
java.lang.String descr,
boolean accDirs)
Creates a filesystem filter for the given extensions with the description supplied in descr . |
|
FilesystemFilter(java.lang.String fileext,
java.lang.String descr)
Creates a filesystem filter for the given extension with the description supplied in descr . |
|
FilesystemFilter(java.lang.String fileext,
java.lang.String descr,
boolean accDirs)
Creates a filesystem filter for the given extension with the description supplied in descr . |
Method Summary | |
boolean |
accept(java.io.File dir)
Whether the given file is accepted by this filter. |
boolean |
accept(java.io.File dir,
java.lang.String name)
Tests if a specified file should be included in a file list. |
void |
addExtension(java.lang.String ext)
Add this extension to the filter. |
java.lang.String |
getDescription()
The description of this filter. |
void |
setAcceptDirectories(boolean b)
Sets whether this filter accepts directories. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public FilesystemFilter(java.lang.String fileext, java.lang.String descr)
descr
. Directories are accepted by default.
fileext
- the file extension that should be accepteddescr
- the description for this filetypepublic FilesystemFilter(java.lang.String fileext, java.lang.String descr, boolean accDirs)
descr
. Directories are accepted if accDirs
is set to true
.
fileext
- the file extension that should be accepteddescr
- the description for this filetypeaccDirs
- true, if directories should be acceptable for this filter.public FilesystemFilter(java.lang.String[] fileext, java.lang.String descr, boolean accDirs)
descr
. Directories are accepted if accDirs
is set to true
.
fileext
- the file extensions that should be accepteddescr
- the description for this filetypeaccDirs
- true, if directories should be acceptable for this filter.Method Detail |
public boolean accept(java.io.File dir, java.lang.String name)
accept
in interface java.io.FilenameFilter
dir
- the directory in which the file was found.name
- the name of the file.
true
if and only if the name should be
included in the file list; false
otherwise.public boolean accept(java.io.File dir)
accept
in class javax.swing.filechooser.FileFilter
dir
- the file that should be checked.
public java.lang.String getDescription()
getDescription
in class javax.swing.filechooser.FileFilter
FileView.getName(java.io.File)
public void setAcceptDirectories(boolean b)
b
- set to true
to accept directories, false otherwisepublic void addExtension(java.lang.String ext)
ext
- the extension that should be added to this filter.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |