public class EdalFileNameExtensionFilter extends EdalAbstractFileFilter
EDALFileFilter that filters using a specified
set of extensions. The extension for a file is the portion of the file name
after the last ".". Files whose name does not contain a "." have no file name
extension. File name extension comparisons are case insensitive.
The following example creates a EDALFileNameExtensionFilter that will
show jpg files:
EDALFileFilter filter = new EDALFileNameExtensionFilter("JPEG file", "jpg", "jpeg");
EDALFileChooser fileChooser = ...;
fileChooser.setFileFilter(filter);
EdalFileChooser.setFileFilter(de.ipk_gatersleben.bit.bi.edal.rmi.client.util.EdalAbstractFileFilter)| Constructor and Description |
|---|
EdalFileNameExtensionFilter(String description,
String... extensions)
Creates a
EDALFileNameExtensionFilter with the specified
description and file name extensions. |
| Modifier and Type | Method and Description |
|---|---|
boolean |
accept(ClientPrimaryDataFile f)
Tests the specified file, returning true if the file is accepted, false
otherwise.
|
String |
getDescription()
The description of this filter.
|
String[] |
getExtensions()
Returns the set of file name extensions files are tested against.
|
String |
toString()
Returns a string representation of the
EDALFileNameExtensionFilter. |
public EdalFileNameExtensionFilter(String description, String... extensions)
EDALFileNameExtensionFilter with the specified
description and file name extensions. The returned
EDALFileNameExtensionFilter will accept all directories and any
file with a file name extension contained in extensions.description - textual description for the filter, may be nullextensions - the accepted file name extensionsIllegalArgumentException - if extensions is null, empty, contains null,
or contains an empty stringaccept(de.ipk_gatersleben.bit.bi.edal.rmi.client.ClientPrimaryDataFile)public boolean accept(ClientPrimaryDataFile f)
EDALFileFilter, or the file is a directory.accept in class EdalAbstractFileFilterf - the File to testpublic String getDescription()
getDescription in class EdalAbstractFileFilterpublic String[] getExtensions()
public String toString()
EDALFileNameExtensionFilter. This method is intended to be used
for debugging purposes, and the content and format of the returned string
may vary between implementations.Copyright © 2013 Leibniz Institute of Plant Genetics and Crop Plant Research (IPK). All rights reserved.