|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjavax.swing.filechooser.FileFilter
ikayaki.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 String |
description
File type desription for the extensions. |
private String[] |
extensions
Extensions to be shown. |
Constructor Summary | |
---|---|
GenericFileFilter(String description,
String... extensions)
Creates a new file filter for the specified file type. |
Method Summary | |
---|---|
boolean |
accept(File pathname)
Tests whether or not the specified abstract pathname should be included in a pathname list. |
String |
getDescription()
Returns the file type description. |
private static String |
getExtension(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 String[] extensions
private String description
Constructor Detail |
---|
public GenericFileFilter(String description, 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(File pathname)
accept
in interface FileFilter
accept
in class FileFilter
pathname
- the abstract pathname to be tested.
private static String getExtension(File f)
f
- the file which's extension is wanted
public String getDescription()
getDescription
in class FileFilter
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |