|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjavax.swing.filechooser.FileFilter
mckay.utilities.general.FileFilterImplementation
public class FileFilterImplementation
A file filter for the JFileChooser class. Implements the two methods of the FileFilter abstract class.
Filters all files except directories and files that end with the given extension. Case is ignored.
Constructor Summary | |
---|---|
FileFilterImplementation(java.lang.String[] extensions)
Instantiate the FileFilterImplementation object to let files with the specified extension(s) pass. |
Method Summary | |
---|---|
boolean |
accept(java.io.File f)
Returns whether the given file should pass through the filter. |
java.lang.String |
getDescription()
Returns a formatted list describing the file extensions that can pass the filter. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public FileFilterImplementation(java.lang.String[] extensions)
extensions
- The extension(s) that this filter will allow to pass.
Case is irrelevant, and the period should be omitted.
For example, {"jpg", "jpeg"} should be passed if this
is to apply to JPEG files. None of these may be null.Method Detail |
---|
public boolean accept(java.io.File f)
accept
in interface java.io.FileFilter
accept
in class javax.swing.filechooser.FileFilter
f
- The File to be tested.
public java.lang.String getDescription()
getDescription
in class javax.swing.filechooser.FileFilter
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |