|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object javax.swing.filechooser.FileFilter acm.util.FileChooserFilter
public class FileChooserFilter
This class extends javax.swing.filechooser.FileFilter
and exists primarily to avoid the ambiguity that arises because there is
also a FileFilter
class in java.io
. This
class also supports simple wildcard matching of filenames.
Constructor Summary | |
---|---|
FileChooserFilter()
Creates a default FileChooserFilter . |
|
FileChooserFilter(String pattern)
Creates a FileChooserFilter that accepts filenames
matching the specified pattern. |
|
FileChooserFilter(String pattern,
String description)
Creates a FileChooserFilter that accepts filenames
matching the specified pattern. |
Method Summary | |
---|---|
boolean |
accept(File file)
Returns true if the specified file should be accepted by
the filter. |
String |
getDescription()
Returns a description of the accepted files. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public FileChooserFilter()
FileChooserFilter
. Such a
FileChooserFilter
is useful only if the client
overrides the accept
and getDescription
methods.
public FileChooserFilter(String pattern)
FileChooserFilter
that accepts filenames
matching the specified pattern. This pattern consists of a
wildcard pattern (or a series of wildcard patterns separated
by semicolons) similar to those by a Unix shell. For example, to
match all files ending with the extensions .html
or .htm
, you could use the following constructor call:
new FileChooserPattern("*.html;*.htm")
pattern
- The filename patternpublic FileChooserFilter(String pattern, String description)
FileChooserFilter
that accepts filenames
matching the specified pattern. This pattern consists of a
wildcard pattern (or a series of wildcard patterns separated
by semicolons) similar to those by a Unix shell. For example, to
match all files ending with the extensions .html
or .htm
, you could use the following constructor call:
new FileChooserPattern("*.html;*.htm")
This version of the constructor makes it possible to set the description that appears in the dialog.
pattern
- The filename patterndescription
- The description of the files for inclusion in the dialogMethod Detail |
---|
public boolean accept(File file)
true
if the specified file should be accepted by
the filter.
accept
in class FileFilter
file
- The File
object representing the file
true
if the specified file should be acceptedpublic String getDescription()
getDescription
in class FileFilter
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |