|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object javax.swing.filechooser.FileFilter uic.widgets.filechooser.AbstractFileFilter uic.widgets.filechooser.UICFileFilter
public class UICFileFilter
A fileFilter that allows you to filter files on regular expressions. Notice that this class also combines an abtract javax.swing.filechooser.FileFilter (with no implementation, which effectively makes it the same as an interface) and the java.io.FileFilter is a real interface, with the same methods but has the first has no reference to the second.
Lets just say that the good authors at Sun missed the obvious; one should extend or implement the other. This class therefor is a good basis to extend further file filters from.
Constructor Summary | |
---|---|
UICFileFilter(String description,
Pattern p)
Create a FileFilter which matches any file on a regular expression. |
|
UICFileFilter(String description,
Pattern p,
boolean acceptDirectories)
Create a FileFilter which matches any file on a regular expression. |
|
UICFileFilter(String description,
String regularExpression)
Create a FileFilter which matches any file on a regular expression. |
Method Summary | |
---|---|
boolean |
accept(File f)
Returns true if the file is accepted by this filter. |
Methods inherited from class uic.widgets.filechooser.AbstractFileFilter |
---|
getDescription |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public UICFileFilter(String description, String regularExpression) throws PatternSyntaxException
description
- the description which will be used in the combo-box of the filechooser.regularExpression
- a correctly formatted regular expression which will be used
case incensitive on each filename.
Regular expressions are very powerfull and can quickly get unreadable to the untrained
eye. Common pitfalls: 1) you need to specify the full name, not a part of it. Add
.*
around your regular expression if you want just a part of the string.
PatternSyntaxException
Pattern
public UICFileFilter(String description, Pattern p)
description
- the description which will be used in the combo-box of the filechooser.p
- a pre-compiled regular-expression pattern.
Regular expressions are very powerfull and can quickly get unreadable to the untrained
eye. Common pitfalls: 1) you need to specify the full name, not a part of it. Add
.*
around your regular expression if you want just a part of the string.Pattern
public UICFileFilter(String description, Pattern p, boolean acceptDirectories)
description
- the description which will be used in the combo-box of the filechooser.p
- a pre-compiled regular-expression pattern.
Regular expressions are very powerfull and can quickly get unreadable to the untrained
eye. Common pitfalls: 1) you need to specify the full name, not a part of it. Add
.*
around your regular expression if you want just a part of the string.acceptDirectories
- should directories be acceptedPattern
Method Detail |
---|
public boolean accept(File f)
accept
in interface FileFilter
accept
in class FileFilter
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |