|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjavax.swing.filechooser.FileFilter
org.esa.beam.util.io.BeamFileFilter
public class BeamFileFilter
A FileFilter with file extensions support.
| Nested Class Summary | |
|---|---|
static class |
BeamFileFilter.FileSelectionMode
File selection modes. |
| Constructor Summary | |
|---|---|
BeamFileFilter()
|
|
BeamFileFilter(String formatName,
String[] extensions,
String description)
|
|
BeamFileFilter(String formatName,
String extension,
String description)
|
|
| Method Summary | ||
|---|---|---|
boolean |
accept(File file)
Tests whether or not the given file is accepted by this filter. |
|
boolean |
checkExtension(File file)
Utility method which checks the extension the given file. |
|
boolean |
checkExtension(String filename)
Utility method which checks the extension the given filename. |
|
static boolean |
checkExtensions(String filename,
String[] extensions)
Utility method which checks the extension the given filename. |
|
String |
getDefaultExtension()
Returns the default extension. |
|
String |
getDescription()
Returns the description of this filter. |
|
String[] |
getExtensions()
Returns the accepted extensions of this filter. |
|
BeamFileFilter.FileSelectionMode |
getFileSelectionMode()
Gets the file selection mode for the BeamFileChooser if this filter is used. |
|
String |
getFormatName()
|
|
static
|
getSortedFileFilters(Iterator<T> pluginIterator)
Return a alphabetically sorted list of file filters originating from a productIO plugin iterator. |
|
boolean |
hasExtensions()
Returns whether or not this file filter has extensions. |
|
boolean |
isCompoundDocument(File dir)
Checks if the given directory represents a compound document. |
|
void |
setDescription(String description)
Returns the description of this filter. |
|
void |
setExtensions(String[] extensions)
Sets the accepted extensions of this filter. |
|
void |
setFormatName(String formatName)
|
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public BeamFileFilter()
public BeamFileFilter(String formatName,
String extension,
String description)
public BeamFileFilter(String formatName,
String[] extensions,
String description)
| Method Detail |
|---|
public String getFormatName()
public void setFormatName(String formatName)
public boolean hasExtensions()
true if sopublic String getDefaultExtension()
getExtensions method.
null if no extensions have bees specified.getExtensions()public String[] getExtensions()
{".jpg", ".gif", ".png"}.
setExtensions(java.lang.String[])public void setExtensions(String[] extensions)
{".jpg", ".gif", ".png"}.
extensions - The array of extensions.getExtensions()public String getDescription()
"JPEG Images (*.jpg,*.jpeg)".
getDescription in class FileFilterFileView.getTypeDescription(java.io.File)public void setDescription(String description)
"JPEG Images (*.jpg,*.jpeg)". If the extension
list is missing in the description text, it is automatically appended.
description - The description, must not be null.getDescription()public boolean checkExtension(File file)
file - the file
true if the given file path ends with one of the registered extensions, false
otherwise.public boolean checkExtension(String filename)
filename - the file name
true if the given file name ends with one of the registered extensions, false
otherwise.
public static boolean checkExtensions(String filename,
String[] extensions)
filename - the file nameextensions - the extension
true if the given file name ends with one of the registered extensions, false
otherwise.public boolean accept(File file)
true if the given file is a directory or the path string ends with one of the registered extensions.
if no extension are defined, the method always returns true
accept in class FileFilterfile - the file to be or not be accepted.
true if given file is accepted by this filterpublic boolean isCompoundDocument(File dir)
BeamFileChooser.
The default implementation returns false.
Clients may override.
dir - The directory to check.
true If the given directory represents a compound document.public BeamFileFilter.FileSelectionMode getFileSelectionMode()
BeamFileChooser if this filter is used.
The default implementation returns BeamFileFilter.FileSelectionMode.FILES_ONLY.
Clients may override.
true if the user can also select directories using this filter.public static <T extends ProductIOPlugIn> List<BeamFileFilter> getSortedFileFilters(Iterator<T> pluginIterator)
pluginIterator - a productIO plugin iterator
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||