|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Object
|
+--javax.swing.filechooser.FileFilter
|
+--flatscape.util.SuffixFileFilter
A FileFilter that accepts only files that end with the provided suffix(es). This filter can be used by the File class and the JFileChooser dialog. Note that suffixes must contain the . if needed. For example:
new SuffixFileFilter("TIFF Files", new String[] {".tif", ".tiff"})
Copyright (c) 2001 Rutgers, The State University of New Jersey
| Field Summary | |
boolean |
acceptDirs
If set to false, all directories are filtered out. |
boolean |
acceptHidden
If set to false, all hidden files and directories are filtered out. |
protected java.lang.String |
description
|
protected java.lang.String[] |
suffixes
|
| Constructor Summary | |
SuffixFileFilter()
Constructs a filter which allows all files. |
|
SuffixFileFilter(java.lang.String suffix)
Constructs a filter which allows only files ending with the specified suffix. |
|
SuffixFileFilter(java.lang.String[] suffixes)
Constructs a filter which allows only files ending with any of the specified suffixes. |
|
SuffixFileFilter(java.lang.String description,
java.lang.String suffix)
Constructs a filter which allows only files ending with the specified suffix, and has the given description. |
|
SuffixFileFilter(java.lang.String description,
java.lang.String[] suffixes)
Constructs a filter which allows only files ending with any of the specified suffixes, and has the given description. |
|
| Method Summary | |
boolean |
accept(java.io.File file)
|
java.lang.Object |
config(java.lang.Object parent,
org.w3c.dom.Element config)
Returns a configured SuffixFileFilter instance. |
java.lang.String |
getDescription()
Returns a String of the description followed by the list of acceptable suffixes. |
static java.lang.String |
stripSuffix(java.io.File file)
Returns the file name minus any suffix present. |
static java.lang.String |
stripSuffix(java.lang.String source)
Returns the the name of a file extracted from a source path. |
java.lang.String |
toString()
Returns the result of the getDescription method. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
protected java.lang.String description
protected java.lang.String[] suffixes
public boolean acceptDirs
public boolean acceptHidden
| Constructor Detail |
public SuffixFileFilter()
public SuffixFileFilter(java.lang.String suffix)
public SuffixFileFilter(java.lang.String[] suffixes)
public SuffixFileFilter(java.lang.String description,
java.lang.String suffix)
public SuffixFileFilter(java.lang.String description,
java.lang.String[] suffixes)
| Method Detail |
public static java.lang.String stripSuffix(java.lang.String source)
public static java.lang.String stripSuffix(java.io.File file)
public java.lang.Object config(java.lang.Object parent,
org.w3c.dom.Element config)
throws java.lang.Exception
config in interface Configurableparent - The argument passed into the FConfig.getList methodconfig - The DOM element representing the XML element that
loaded this class.
java.lang.Exception - Thrown if there is any problem configuring this class.public boolean accept(java.io.File file)
accept in interface java.io.FileFilteraccept in class javax.swing.filechooser.FileFilterpublic java.lang.String getDescription()
getDescription in class javax.swing.filechooser.FileFilterpublic java.lang.String toString()
toString in class java.lang.Object
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||