Package smile.swing
Class FileChooser.SimpleFileFilter
java.lang.Object
javax.swing.filechooser.FileFilter
smile.swing.FileChooser.SimpleFileFilter
- Enclosing class:
FileChooser
A simple extension-based file filter. Accept all directories and known
file extensions. Extensions are typically found on Windows and Unix,
but not on Macinthosh. Case is ignored.
-
Constructor Summary
ConstructorDescriptionSimpleFileFilter
(String description, String extension) Creates a file filter that accepts the given file type.SimpleFileFilter
(String description, String... filters) Creates a file filter from the given string array and description.SimpleFileFilter
(String description, Collection<String> filters) Creates a file filter from the given string array and description. -
Method Summary
Modifier and TypeMethodDescriptionboolean
void
addExtension
(String extension) Adds a file type "dot" extension to filter against.Returns the human-readable description of this filter.static FileChooser.SimpleFileFilter
Returns the filter for readable images.static FileChooser.SimpleFileFilter
Returns the filter for writable images.void
setDescription
(String description) Sets the human-readable description of this filter.
-
Constructor Details
-
SimpleFileFilter
Creates a file filter that accepts the given file type. Note that the "." before the extension is not needed. If provided, it will be ignored. -
SimpleFileFilter
Creates a file filter from the given string array and description. Note that the "." before the extension is not needed and will be ignored. -
SimpleFileFilter
Creates a file filter from the given string array and description. Note that the "." before the extension is not needed and will be ignored.
-
-
Method Details
-
getReadableImageFilter
Returns the filter for readable images. -
getWritableImageFIlter
Returns the filter for writable images. -
accept
- Specified by:
accept
in classFileFilter
-
addExtension
Adds a file type "dot" extension to filter against. Note that the "." before the extension is not needed and will be ignored. -
getDescription
Returns the human-readable description of this filter.- Specified by:
getDescription
in classFileFilter
-
setDescription
Sets the human-readable description of this filter.
-