|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--javax.swing.filechooser.FileFilter | +--weka.gui.ExtensionFileFilter
Provides a file filter for FileChoosers that accepts or rejects files based on their extension. Compatible with both java.io.FilenameFilter and javax.swing.filechooser.FileFilter (why there are two I have no idea).
Field Summary | |
protected String |
m_Description
The text description of the types of files accepted |
protected String |
m_Extension
The filename extension of accepted files |
Constructor Summary | |
ExtensionFileFilter(String extension,
String description)
Creates the ExtensionFileFilter |
Method Summary | |
boolean |
accept(File file)
Returns true if the supplied file should be accepted (i.e. if it has the required extension or is a directory). |
boolean |
accept(File dir,
String name)
Returns true if the file in the given directory with the given name should be accepted. |
String |
getDescription()
Gets the description of accepted files. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
protected String m_Description
protected String m_Extension
Constructor Detail |
public ExtensionFileFilter(String extension, String description)
extension
- the extension of accepted files.description
- a text description of accepted files.Method Detail |
public String getDescription()
getDescription
in class FileFilter
public boolean accept(File file)
accept
in class FileFilter
file
- the file of interest.
public boolean accept(File dir, String name)
accept
in interface FilenameFilter
dir
- the directory where the file resides.name
- the name of the file.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |