public class FilesystemFilter extends javax.swing.filechooser.FileFilter implements java.io.FilenameFilter
Constructor and Description |
---|
FilesystemFilter(java.lang.String[] fileext,
java.lang.String descr,
boolean accDirs)
Creates a new filter.
|
FilesystemFilter(java.lang.String fileext,
java.lang.String descr)
Creates a new filter.
|
FilesystemFilter(java.lang.String fileext,
java.lang.String descr,
boolean accDirs)
Creates a new filter.
|
Modifier and Type | Method and Description |
---|---|
boolean |
accept(java.io.File dir)
Returns
true if the specified file matches the requirements of this
filter, and false otherwise. |
boolean |
accept(java.io.File dir,
java.lang.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.
|
java.lang.String |
getDescription()
Returns the filter description.
|
public FilesystemFilter(java.lang.String fileext, java.lang.String descr)
fileext
- the file extension.descr
- the description.public FilesystemFilter(java.lang.String fileext, java.lang.String descr, boolean accDirs)
fileext
- the file extension.descr
- the description.accDirs
- accept directories?public FilesystemFilter(java.lang.String[] fileext, java.lang.String descr, boolean accDirs)
fileext
- the file extension.descr
- the description.accDirs
- accept directories?java.lang.NullPointerException
- if the file extensions are null.public boolean accept(java.io.File dir, java.lang.String name)
true
if the file is accepted, and false
otherwise.accept
in interface java.io.FilenameFilter
dir
- the directory.name
- the file name.public boolean accept(java.io.File dir)
true
if the specified file matches the requirements of this
filter, and false
otherwise.accept
in class javax.swing.filechooser.FileFilter
dir
- the file or directory.public java.lang.String getDescription()
getDescription
in class javax.swing.filechooser.FileFilter
public void acceptDirectories(boolean b)
b
- a boolean.public boolean acceptsDirectories()