public class DefaultFileFilter extends FileFilter
JFileChooser
.Modifier and Type | Class and Description |
---|---|
static class |
DefaultFileFilter.EditorFileFilter
Utility file filter to accept editor files, namely .xml and .xml.gz
extensions.
|
static class |
DefaultFileFilter.ImageFileFilter
Utility file filter to accept all image formats supported by image io.
|
Modifier and Type | Field and Description |
---|---|
protected String |
desc
Description of accepted files.
|
protected String |
ext
Extension of accepted files.
|
Constructor and Description |
---|
DefaultFileFilter(String extension,
String description)
Constructs a new filter for the specified extension and description.
|
Modifier and Type | Method and Description |
---|---|
boolean |
accept(File file)
Returns true if
file is a directory or ends with the
specified extension. |
String |
getDescription()
Returns the description for accepted files.
|
String |
getExtension()
Returns the extension for accepted files.
|
void |
setExtension(String extension)
Sets the extension for accepted files.
|
protected String ext
protected String desc
public boolean accept(File file)
file
is a directory or ends with the
specified extension.accept
in class FileFilter
file
- The file to be checked.public String getDescription()
getDescription
in class FileFilter
public String getExtension()
public void setExtension(String extension)
extension
- The extension to set.Copyright © 2015–2021 Fiji. All rights reserved.