public class FileFilterFactory
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
WILDCARD_FILE_EXTENSION
wildcard extension
|
Modifier | Constructor and Description |
---|---|
protected |
FileFilterFactory()
Creates a new instance of FileFilterFactory
|
Modifier and Type | Method and Description |
---|---|
static javax.swing.JFileChooser |
applyFileFilters(javax.swing.JFileChooser fileChooser,
java.lang.String[] fileTypes)
Applies the file filters to the file chooser and returns this file chooser.
|
protected static java.lang.String |
getFileExtension(java.io.File file)
Determine the file's extension.
|
static javax.swing.filechooser.FileFilter |
getFileFilter(java.lang.String fileType)
Create a file filter that accepts files of the specified type.
|
static javax.swing.filechooser.FileFilter |
getSupportedFileFilter(java.lang.String[] fileTypes)
Create a file filter that accepts files of the specified types.
|
protected static boolean |
isMatch(java.lang.String extension,
java.lang.String fileType)
Determine whether the extension matches the file type.
|
public static final java.lang.String WILDCARD_FILE_EXTENSION
protected FileFilterFactory()
public static javax.swing.JFileChooser applyFileFilters(javax.swing.JFileChooser fileChooser, java.lang.String[] fileTypes)
fileChooser
- the file chooser to which to add the file filtersfileTypes
- An array of file types to acceptpublic static javax.swing.filechooser.FileFilter getFileFilter(java.lang.String fileType)
fileType
- File type to acceptpublic static javax.swing.filechooser.FileFilter getSupportedFileFilter(java.lang.String[] fileTypes)
fileTypes
- Array of file types to acceptprotected static java.lang.String getFileExtension(java.io.File file)
file
- the file for which to get the extensionprotected static boolean isMatch(java.lang.String extension, java.lang.String fileType)
extension
- the file extension to test for matching to the file type.fileType
- the file type against which to test for matching the file extension.