|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjavax.swing.filechooser.FileFilter
com.saic.isd.swing.filechooser.SimpleFileFilter
A file filter which determines what files to accept for a given extension,
also accepting all directories.
An extension refers to the part of a file name after the final period.
Here are some examples:
file.txt - txt is the extension
network.xml - xml is the extension
SAIC.RunThis.pl - pl is the extension
a.ridiculus.example.doc - doc is the extension
foo - there is no extension
Code originally borrowed from:
Sun's ExampleFileFilter version 1.9 by Jeff Dinkins
Constructor Summary | |
SimpleFileFilter(java.lang.String extension)
Creates a new FileFilter which will accept files based on the extension provided, ignoring case. |
|
SimpleFileFilter(java.lang.String extension,
java.lang.String description)
Creates a new FileFilter which will accept files based on the extension provided, ignoring case. |
|
SimpleFileFilter(java.lang.String extension,
java.lang.String description,
boolean caseSensitive)
Creates a new FileFilter which will accept files based on the extension provided. |
Method Summary | |
boolean |
accept(java.io.File f)
Tests a file for acceptability. |
java.io.File |
attachExtension(java.io.File file)
Adds the extension to a file if it does not have that extension already. |
java.lang.String |
getDescription()
|
java.lang.String |
getExtension()
Gets the extendsion. |
static java.lang.String |
getExtension(java.io.File f)
Returns the extension of a file. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public SimpleFileFilter(java.lang.String extension)
extension
- Required, may not contain a period.public SimpleFileFilter(java.lang.String extension, java.lang.String description)
extension
- Required, may not contain a period.description
- public SimpleFileFilter(java.lang.String extension, java.lang.String description, boolean caseSensitive)
extension
- Required, may not contain a period.description
- caseSensitive
- if true the extension's case must match exactly.Method Detail |
public java.lang.String getDescription()
public boolean accept(java.io.File f)
public java.lang.String getExtension()
public java.io.File attachExtension(java.io.File file)
file
-
public static java.lang.String getExtension(java.io.File f)
f
- nulls not permitted.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |