public class ExtensionFileFilter extends javax.swing.filechooser.FileFilter implements java.io.FileFilter
| Modifier and Type | Field and Description |
|---|---|
private java.lang.String |
defaultExtension |
private java.lang.String |
description |
static java.util.ArrayList<FileExporter> |
exporters
List of supported formats for export.
|
private java.lang.String |
extensions |
static java.util.ArrayList<FileImporter> |
importers
List of supported formats for import.
|
| Constructor and Description |
|---|
ExtensionFileFilter(java.lang.String extension,
java.lang.String defaultExtension,
java.lang.String description)
Construct an extension file filter by giving the extension to check after.
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
accept(java.io.File pathname) |
boolean |
acceptName(java.lang.String filename)
Returns true if this file filter accepts the given filename.
|
static void |
applyChoosableExportFileFilters(AbstractFileChooser fileChooser,
java.lang.String extension,
boolean allTypes)
Applies the choosable
FileFilter to a AbstractFileChooser before using the
file chooser for selecting a file for writing. |
static void |
applyChoosableImportFileFilters(AbstractFileChooser fileChooser,
java.lang.String extension,
boolean allTypes)
Applies the choosable
FileFilter to a AbstractFileChooser before using the
file chooser for selecting a file for reading. |
boolean |
equals(java.lang.Object obj) |
static ExtensionFileFilter |
getDefaultExportExtensionFileFilter(java.lang.String extension)
Replies the default
ExtensionFileFilter for a given extension |
java.lang.String |
getDefaultExtension()
Replies the default file extension of this file filter.
|
static ExtensionFileFilter |
getDefaultImportExtensionFileFilter(java.lang.String extension)
Replies the default
ExtensionFileFilter for a given extension |
java.lang.String |
getDescription() |
static java.util.List<ExtensionFileFilter> |
getExportExtensionFileFilters()
Replies an ordered list of enabled
ExtensionFileFilters for exporting. |
java.lang.String |
getExtensions()
Replies the comma-separated list of file extensions of this file filter.
|
static java.util.List<ExtensionFileFilter> |
getImportExtensionFileFilters()
Replies an ordered list of
ExtensionFileFilters for importing. |
int |
hashCode() |
protected static void |
sort(java.util.List<ExtensionFileFilter> filters) |
static void |
updateAllFormatsImporter()
Updates the
AllFormatsImporter that is contained in the importers list. |
public static final java.util.ArrayList<FileImporter> importers
public static final java.util.ArrayList<FileExporter> exporters
private final java.lang.String extensions
private final java.lang.String description
private final java.lang.String defaultExtension
public ExtensionFileFilter(java.lang.String extension, java.lang.String defaultExtension, java.lang.String description)
extension - The comma-separated list of file extensionsdefaultExtension - The default extensiondescription - A short textual description of the file typeprotected static void sort(java.util.List<ExtensionFileFilter> filters)
public static void updateAllFormatsImporter()
AllFormatsImporter that is contained in the importers list. If
you do not use the importers variable directly, you don’t need to call this.
Updating the AllFormatsImporter is required when plugins add new importers that support new file extensions. The old AllFormatsImporter doesn’t include the new extensions and thus will not display these files.
public static java.util.List<ExtensionFileFilter> getImportExtensionFileFilters()
ExtensionFileFilters for importing.
The list is ordered according to their description, an AllFormatsImporter
is append at the end.ExtensionFileFilters for importing.public static java.util.List<ExtensionFileFilter> getExportExtensionFileFilters()
ExtensionFileFilters for exporting.
The list is ordered according to their description, an AllFormatsImporter
is append at the end.ExtensionFileFilters for exporting.public static ExtensionFileFilter getDefaultImportExtensionFileFilter(java.lang.String extension)
ExtensionFileFilter for a given extensionextension - the extensionExtensionFileFilter for a given extensionpublic static ExtensionFileFilter getDefaultExportExtensionFileFilter(java.lang.String extension)
ExtensionFileFilter for a given extensionextension - the extensionExtensionFileFilter for a given extensionpublic static void applyChoosableImportFileFilters(AbstractFileChooser fileChooser, java.lang.String extension, boolean allTypes)
FileFilter to a AbstractFileChooser before using the
file chooser for selecting a file for reading.fileChooser - the file chooserextension - the default extensionallTypes - If true, all the files types known by JOSM will be proposed in the "file type" combobox.
If false, only the file filters that include extension will be proposedpublic static void applyChoosableExportFileFilters(AbstractFileChooser fileChooser, java.lang.String extension, boolean allTypes)
FileFilter to a AbstractFileChooser before using the
file chooser for selecting a file for writing.fileChooser - the file chooserextension - the default extensionallTypes - If true, all the files types known by JOSM will be proposed in the "file type" combobox.
If false, only the file filters that include extension will be proposedpublic boolean acceptName(java.lang.String filename)
filename - The filename to check afterpublic boolean accept(java.io.File pathname)
accept in interface java.io.FileFilteraccept in class javax.swing.filechooser.FileFilterpublic java.lang.String getDescription()
getDescription in class javax.swing.filechooser.FileFilterpublic java.lang.String getExtensions()
public java.lang.String getDefaultExtension()
public int hashCode()
hashCode in class java.lang.Objectpublic boolean equals(java.lang.Object obj)
equals in class java.lang.Object