public class SuffixFileFilter
extends javax.swing.filechooser.FileFilter
Modifier and Type | Field and Description |
---|---|
private java.lang.String[] |
acceptedSuffixes
The collection of suffixes that match the filter
|
private java.lang.String |
description
The description of the filter
|
Constructor and Description |
---|
SuffixFileFilter(java.lang.String pDescription,
java.lang.String[] pAcceptedSuffixes)
Create a new filter with the supplied description and collection of
suffixes.
|
Modifier and Type | Method and Description |
---|---|
boolean |
accept(java.io.File file) |
java.lang.String |
getDescription() |
java.io.File |
makeWithPrimarySuffix(java.io.File file)
Check whether the supplied file's name agrees with this suffix file filter.
|
private void |
setAcceptedSuffixes(java.lang.String[] pAcceptedSuffixes)
Set the collection of suffix patterns to be accepted by this filter
|
private void |
setDescription(java.lang.String pDescription)
Set the description for this filter
|
private java.lang.String description
private java.lang.String[] acceptedSuffixes
public SuffixFileFilter(java.lang.String pDescription, java.lang.String[] pAcceptedSuffixes)
pDescription
- The description of the filter to be shown to the userpAcceptedSuffixes
- The set of file suffix patterns that match the filterprivate void setDescription(java.lang.String pDescription)
pDescription
- The filter descriptionprivate void setAcceptedSuffixes(java.lang.String[] pAcceptedSuffixes)
pAcceptedSuffixes
- The accepted suffix patternspublic java.io.File makeWithPrimarySuffix(java.io.File file)
file
- The file whose name is to be check against this filterpublic boolean accept(java.io.File file)
accept
in class javax.swing.filechooser.FileFilter
public java.lang.String getDescription()
getDescription
in class javax.swing.filechooser.FileFilter