|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjavax.swing.filechooser.FileFilter
ucar.unidata.util.PatternFileFilter
public class PatternFileFilter
This holds a set of regular expression patterns that are used for file filters in a JFileChooser. You can also pass in an Object id (which can be used as the client code sees fit) and a directoriesOk flag.
| Field Summary | |
|---|---|
static Object |
NULL_OBJECT_ID
Used for passing in a null object id |
| Constructor Summary | |
|---|---|
PatternFileFilter(String patternsString)
Create a new PatternFileFilter. |
|
PatternFileFilter(String patternsString,
boolean dirsOk)
Create a new PatternFileFilter. |
|
PatternFileFilter(String patternsString,
boolean dirsOk,
boolean hiddenOk)
Create a new PatternFileFilter. |
|
PatternFileFilter(String patternsString,
Object id,
String description)
Create a new PatternFileFilter. |
|
PatternFileFilter(String patternsString,
Object id,
String description,
String suffix)
Create a new PatternFileFilter. |
|
PatternFileFilter(String patternsString,
String description)
Create a new PatternFileFilter. |
|
PatternFileFilter(String patternsString,
String description,
String suffix)
Create a new PatternFileFilter. |
|
| Method Summary | |
|---|---|
boolean |
accept(File file)
Does this pattern match the given file. |
boolean |
accept(File dir,
String name)
Implement the FilenameFilter method |
static List |
createFilters(String filterString)
Parse the given string and return a list of PatternFileFilter-s The string is a ";" delimited list of pattern specifications of the form: pattern":"description or: just the pattern. |
String |
getDescription()
Return the description. |
Object |
getId()
Return the object id. |
String |
getPreferredSuffix()
Get the PreferredSuffix property. |
static void |
main(String[] args)
Test |
boolean |
match(String name)
Does this pattern match the given file. |
void |
setPreferredSuffix(String value)
Set the PreferedSuffix property. |
String |
toString()
Override base class method. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
public static final Object NULL_OBJECT_ID
| Constructor Detail |
|---|
public PatternFileFilter(String patternsString,
String description)
patternsString - A comma separated list of regular expressions.description - The label to use in the JFileChooser
public PatternFileFilter(String patternsString,
String description,
String suffix)
patternsString - A comma separated list of regular expressions.description - The label to use in the JFileChoosersuffix - The preferred suffix if none is provided.public PatternFileFilter(String patternsString)
patternsString - A comma separated list of regular expressions.
public PatternFileFilter(String patternsString,
boolean dirsOk)
patternsString - A comma separated list of regular expressions.dirsOk - Are directories ok to display.
public PatternFileFilter(String patternsString,
boolean dirsOk,
boolean hiddenOk)
patternsString - A comma separated list of regular expressions.dirsOk - Are directories ok to display.hiddenOk - true if hidden files are okay.
public PatternFileFilter(String patternsString,
Object id,
String description)
patternsString - A comma separated list of regular expressions.id - An arbitary Object for client code to use.description - The label to use in the JFileChooser
public PatternFileFilter(String patternsString,
Object id,
String description,
String suffix)
patternsString - A comma separated list of regular expressions.id - An arbitary Object for client code to use.description - The label to use in the JFileChoosersuffix - The preferred suffix if none is provided.| Method Detail |
|---|
public static List createFilters(String filterString)
filterString - The string of semi-colon delimited filters.
public Object getId()
public String toString()
toString in class Objectpublic boolean accept(File file)
accept in interface FileFilteraccept in class FileFilterfile - The given file.
public boolean accept(File dir,
String name)
accept in interface FilenameFilterdir - directory to checkname - name of file
public boolean match(String name)
name - The given file.
public String getDescription()
getDescription in class FileFilterpublic void setPreferredSuffix(String value)
value - The new value for PreferedSuffixpublic String getPreferredSuffix()
public static void main(String[] args)
args - Command line args.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||