com.ibm.able.beans.fuzzy
Class FsFileFilter
java.lang.Object
|
+--javax.swing.filechooser.FileFilter
|
+--com.ibm.able.beans.fuzzy.FsFileFilter
- public class FsFileFilter
- extends javax.swing.filechooser.FileFilter
A convenience implementation of FileFilter that filters out all
files except for those file extensions that it knows about.
File extensions are of the type ".foo", which are typically found
on OS/2, Unix, and windows boxes, but not on Macinthosh. Case is
ignored.
Example - create a new filter that filters out all files
but "rs" and "frs" fuzzy rule files:
JFileChooser chooser = new JFileChooser();
FsFileFilter filter = new FsFileFilter(new String{"rs", "frs"})
chooser.addChoosableFileFilter(filter);
chooser.showOpenDialog(this);
- Version:
- 1.0.0; change log:
Version Description
-------- -----------
1.0.0 Initial release.
Constructor Summary |
FsFileFilter(java.lang.String[] theFilters,
java.lang.String theDescription)
Creates a file filter from the given string array and description. |
Method Summary |
boolean |
accept(java.io.File theFile)
Determine whether a file should be included in the dialog
selection box. |
void |
addExtension(java.lang.String theExtension)
Add another extension to the list of filters. |
java.lang.String |
getDescription()
|
Methods inherited from class java.lang.Object |
clone,
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
toString,
wait,
wait,
wait |
FsFileFilter
public FsFileFilter(java.lang.String[] theFilters,
java.lang.String theDescription)
- Creates a file filter from the given string array and description.
Example:
new FsFileFilter(String {"rs", "frs"}, "Fuzzy ruleset source files");
Note that the "." before the extension is not needed and will
be ignored.
- Parameters:
theFilters
- an array of strings represent file types on which to
filter files.
- See Also:
addExtension(java.lang.String)
accept
public boolean accept(java.io.File theFile)
- Determine whether a file should be included in the dialog
selection box.
Note that files that begin with "." are ignored.
- Parameters:
theFilters
- an array of strings that represent file types on which
to filter files.
- Returns:
- true if the file should be displayed in the
selection box, false otherwise.
- Overrides:
- accept in class javax.swing.filechooser.FileFilter
- See Also:
FileFilter.accept(java.io.File)
getDescription
public java.lang.String getDescription()
- Overrides:
- getDescription in class javax.swing.filechooser.FileFilter
addExtension
public void addExtension(java.lang.String theExtension)
- Add another extension to the list of filters. Note that the "."
before the extension is not needed and will be ignored. Also,
case is ignored.
- Parameters:
theExtension
- an extension on which to filter.
ABLE: Produced by Joe, Don, and Jeff who say, 'Thanks for your support.'