Inheritance diagram for FileExtensionFilter:
Public Member Functions | |
FileExtensionFilter () | |
FileExtensionFilter (String[] exts) | |
FileExtensionFilter (String[] exts, boolean directories, Visibility vis) | |
If there are dots in the beginning of the exts, we remove them, so that they will still work. | |
boolean | accept (File f) |
This method is for filechoosers, and makes use of acceptDirectories. | |
boolean | accept (File parentDir, String name) |
String | getDescription () |
A string description to display in file choosers. | |
void | setAcceptDirectories (boolean acceptDirs) |
If we are accepting directories, then ALL directories will be accepted. | |
Static Public Attributes | |
static final String[] | ACCEPT_ALL = new String[] { "" } |
This software is distributed under the BSD License.
Definition at line 21 of file FileExtensionFilter.java.
FileExtensionFilter | ( | String[] | exts | ) |
FileExtensionFilter | ( | String[] | exts, | |
boolean | directories, | |||
Visibility | vis | |||
) |
If there are dots in the beginning of the exts, we remove them, so that they will still work.
exts | Pass in null or "" to accept all files. Otherwise, pass in an array of extensions without dots, such as {"jpg", "jpeg", "mpg", "mpeg"}. The matching is case INSENSITIVE. | |
directories | true --> we will include directories. | |
vis | BOTH --> we will include files or directories that are hidden or whose names start with dots (e.g., .bashrc). |
Definition at line 70 of file FileExtensionFilter.java.
References FileExtensionFilter.ACCEPT_ALL.
boolean accept | ( | File | f | ) |
This method is for filechoosers, and makes use of acceptDirectories.
Reimplemented in FileExcludeHiddenFilter.
Definition at line 99 of file FileExtensionFilter.java.
String getDescription | ( | ) |
A string description to display in file choosers.
Definition at line 159 of file FileExtensionFilter.java.
void setAcceptDirectories | ( | boolean | acceptDirs | ) |
If we are accepting directories, then ALL directories will be accepted.
We do not apply extensions to directory names. This makes it so that directories will appear in the file chooser even if we have this FileExtensionFilter applied.
acceptDirs |
Definition at line 180 of file FileExtensionFilter.java.