|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjavax.swing.filechooser.FileFilter
org.openstreetmap.josm.actions.ExtensionFileFilter
public class ExtensionFileFilter
A file filter that filters after the extension. Also includes a list of file filters used in JOSM.
Field Summary | |
---|---|
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 Summary | |
---|---|
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. |
Method Summary | |
---|---|
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(javax.swing.JFileChooser fileChooser,
java.lang.String extension,
boolean allTypes)
Applies the choosable FileFilter to a JFileChooser before using the
file chooser for selecting a file for writing. |
static void |
applyChoosableImportFileFilters(javax.swing.JFileChooser fileChooser,
java.lang.String extension,
boolean allTypes)
Applies the choosable FileFilter to a JFileChooser 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 ExtensionFileFilter s 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 ExtensionFileFilter s 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. |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
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
Constructor Detail |
---|
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 typeMethod Detail |
---|
protected 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()
ExtensionFileFilter
s for importing.
The list is ordered according to their description, an AllFormatsImporter
is append at the end.
ExtensionFileFilter
s for importing.public static java.util.List<ExtensionFileFilter> getExportExtensionFileFilters()
ExtensionFileFilter
s for exporting.
The list is ordered according to their description, an AllFormatsImporter
is append at the end.
ExtensionFileFilter
s for exporting.public static ExtensionFileFilter getDefaultImportExtensionFileFilter(java.lang.String extension)
ExtensionFileFilter
for a given extension
extension
- the extension
ExtensionFileFilter
for a given extensionpublic static ExtensionFileFilter getDefaultExportExtensionFileFilter(java.lang.String extension)
ExtensionFileFilter
for a given extension
extension
- the extension
ExtensionFileFilter
for a given extensionpublic static void applyChoosableImportFileFilters(javax.swing.JFileChooser fileChooser, java.lang.String extension, boolean allTypes)
FileFilter
to a JFileChooser
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(javax.swing.JFileChooser fileChooser, java.lang.String extension, boolean allTypes)
FileFilter
to a JFileChooser
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 after
public boolean accept(java.io.File pathname)
accept
in class javax.swing.filechooser.FileFilter
public java.lang.String getDescription()
getDescription
in class javax.swing.filechooser.FileFilter
public java.lang.String getExtensions()
public java.lang.String getDefaultExtension()
public int hashCode()
hashCode
in class java.lang.Object
public boolean equals(java.lang.Object obj)
equals
in class java.lang.Object
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |