|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectjavax.swing.filechooser.FileFilter
org.dmonix.io.filters.RegExpFilter
A file filter that uses regular expression matching.
The filter compares the absolute path name of the file towards the
provided regular expression.
As well as implementing the FileFilter and FilenameFilter
interfaces the class also extends the javax.swing.filechooser.FileFilter class.
This way the filter can be used in all standard file filtering as well as in conjunction with
the JFileChooser class.
Copyright: Copyright (c) 2004
Company: dmonix.org
| Constructor Summary | |
protected |
RegExpFilter()
|
|
RegExpFilter(java.util.regex.Pattern filter)
Creates a filter using the provided pattern. |
|
RegExpFilter(java.lang.String regex)
Creates a filter using the provided regular expression. |
|
RegExpFilter(java.lang.String regex,
boolean caseSensitive)
Creates a filter using the provided regular expression. |
| Method Summary | |
boolean |
accept(java.io.File f)
The method will match the absolute file path towards the regular expression pattern. |
boolean |
accept(java.io.File dir,
java.lang.String name)
The method will match the absolute file path towards the regular expression pattern. |
java.lang.String |
getDescription()
Returns the description of the currently used pattern. |
java.util.regex.Pattern |
getPattern()
Get the pattern that is used by this filter. |
void |
setDescription(java.lang.String s)
Set the description of the filter. |
void |
setPattern(java.util.regex.Pattern filter)
Set the pattern that is to be used by this filter. |
void |
setPattern(java.lang.String regex)
Set the pattern that is to be used by this filter. |
void |
setPattern(java.lang.String regex,
boolean caseSensitive)
Set the pattern that is to be used by this filter. |
java.lang.String |
toString()
Returns the string representation of the currently used regular expression pattern. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
public RegExpFilter(java.lang.String regex)
java.util.regex.Pattern
regex - The regular expressionPattern
public RegExpFilter(java.lang.String regex,
boolean caseSensitive)
java.util.regex.Pattern
regex - The regular expressioncaseSensitive - If the matcher shall be case sensitive or notPatternpublic RegExpFilter(java.util.regex.Pattern filter)
filter - The patternprotected RegExpFilter()
| Method Detail |
public boolean accept(java.io.File dir,
java.lang.String name)
accept in interface java.io.FilenameFilterdir - The file directoryname - The file name
public boolean accept(java.io.File f)
accept in interface java.io.FileFilterf - The file to match towards
public java.lang.String getDescription()
setDescription(String)public void setDescription(java.lang.String s)
JFileChooser
s - The descriptionpublic java.util.regex.Pattern getPattern()
public void setPattern(java.util.regex.Pattern filter)
filter - The patternpublic void setPattern(java.lang.String regex)
regex - The pattern
public void setPattern(java.lang.String regex,
boolean caseSensitive)
regex - The patterncaseSensitive - If the matcher shall be case sensitive or notpublic java.lang.String toString()
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||