com.togethersoft.openapi.util.file
Class WildcardFileFilter
java.lang.Object
|
+--javax.swing.filechooser.FileFilter
|
+--com.togethersoft.openapi.util.file.WildcardFileFilter
- public class WildcardFileFilter
- extends FileFilter
- implements WildcardCharacters
File filter implementation which can be set on a JFileChooser to
keep unwanted files from appearing in the directory listing. Files mask can include wildcard characters '*' and '?'.
Wildcard characters support implemented with OROMatcher library.
- Author:
- TogetherSoft
| Constructor Summary |
WildcardFileFilter(String fileMask) Creates a file filter that accepts files with the given file mask with support of wildcard characters * and ?. |
| Method Summary |
boolean | accept(File file) Whether the given file is accepted by this filter. |
boolean | accept(String fileName) Whether the given filename is accepted by this filter. |
String | getDescription() Returns the description of this filter. |
void | setDescription(String description) Sets the description of this filter. |
| Methods inherited from class java.lang.Object |
getClass, hashCode, equals, clone, toString, notify, notifyAll, wait, wait, wait, finalize |
WildcardFileFilter
public WildcardFileFilter(String fileMask)
- Creates a file filter that accepts files with the given file mask with support of wildcard characters * and ?.
Example: new WildcardFilter("?lass???.j*");
accept
public boolean accept(File file)
- Whether the given file is accepted by this filter.
- See Also:
- javax.swing.filechooser.FileFilter.accept(java.io.File)
accept
public boolean accept(String fileName)
- Whether the given filename is accepted by this filter.
getDescription
public String getDescription()
- Returns the description of this filter. For example: "JPEG and GIF Image Files (*.jpg, *.gif)"
setDescription
public void setDescription(String description)
- Sets the description of this filter. For example: "JPG and GIF Images"
to Class com.togethersoft.openapi.util.file.WildcardFileFilter.Mask- File name part of file mask
to Class com.togethersoft.openapi.util.file.WildcardFileFilter.Mask
- Extension part of file mask
to Class java.lang.String
- The human readable description of this filter.