|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object javax.swing.filechooser.FileFilter mavis.gui.GenericFileFilter
public class GenericFileFilter
A FileFilter for a FileChooser. Can be used to show only some file types, determined by extension.
Field Summary | |
---|---|
private java.lang.String |
description
File type desription for the extensions. |
private java.lang.String[] |
extensions
Extensions to be shown. |
Constructor Summary | |
---|---|
GenericFileFilter(java.lang.String description,
java.lang.String... extensions)
Creates a new file filter for the specified file type. |
Method Summary | |
---|---|
boolean |
accept(java.io.File pathname)
Tests whether or not the specified abstract pathname should be included in a pathname list. |
java.lang.String |
getDescription()
Returns the file type description. |
private static java.lang.String |
getExtension(java.io.File f)
Returns the extension of the given file. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
private java.lang.String[] extensions
private java.lang.String description
Constructor Detail |
---|
public GenericFileFilter(java.lang.String description, java.lang.String... extensions)
description
- a description for the file type, or null to have no description.extensions
- the file extensions that should be shown, or null to accept no extensions.Method Detail |
---|
public boolean accept(java.io.File pathname)
accept
in interface java.io.FileFilter
accept
in class javax.swing.filechooser.FileFilter
pathname
- the abstract pathname to be tested.
private static java.lang.String getExtension(java.io.File f)
f
- the file which's extension is wanted
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 |