|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjavax.swing.filechooser.FileFilter
bb.io.filefilter.OmniFilter
public class OmniFilter
This file filter accepts all files. One of the constructors allows you to specify whether or not to accept directories also. (The default is to accept directories.)
Note that this class is both a subclass of javax.swing.filechooser.FileFilter
(so that it can be passed to JFileChooser
),
as well as an implementation of java.io.FileFilter
(so that it is suitable as an argument to File.listFiles
).
This class is multithread safe: it is immutable (both its immediate state, as well as the deep state of its fields).
Field Summary | |
---|---|
private boolean |
acceptDirectory
|
Constructor Summary | |
---|---|
OmniFilter()
Constructs a new OmniFilter instance; directories are accepted. |
|
OmniFilter(boolean acceptDirectory)
Constructs a new OmniFilter instance with the specification for whether to accept directories or not. |
Method Summary | |
---|---|
boolean |
accept(File file)
Reports whether or not the supplied File is accepted by this filter. |
String |
getDescription()
Returns a description of this filter. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
private final boolean acceptDirectory
Constructor Detail |
---|
public OmniFilter()
public OmniFilter(boolean acceptDirectory)
Method Detail |
---|
public boolean accept(File file) throws IllegalArgumentException, SecurityException
accept
in interface FileFilter
accept
in class FileFilter
IllegalArgumentException
- if file is null
SecurityException
- if a security manager exists and its SecurityManager.checkRead(java.lang.String) method denies read access to the filepublic String getDescription()
getDescription
in class FileFilter
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |