public static final class CommonDialogs.ExtensionFilter
extends java.lang.Object
ExtensionFilter
that will show
txt
files:
Listextensions = new ArrayList (); extensions.add("*.txt"); ExtensionFilter filter = new ExtensionFilter("Text files", extensions); List filters = new ArrayList (); filters.add(filters); FileChooser.show(..., filters);
Modifier and Type | Field and Description |
---|---|
private java.lang.String |
description |
private java.util.List<java.lang.String> |
extensions |
Constructor and Description |
---|
ExtensionFilter(java.lang.String description,
java.util.List<java.lang.String> extensions)
Creates an
ExtensionFilter with the specified description
and the file name extensions. |
Modifier and Type | Method and Description |
---|---|
private java.lang.String[] |
extensionsToArray() |
java.lang.String |
getDescription() |
java.util.List<java.lang.String> |
getExtensions() |
private final java.lang.String description
private final java.util.List<java.lang.String> extensions
public ExtensionFilter(java.lang.String description, java.util.List<java.lang.String> extensions)
ExtensionFilter
with the specified description
and the file name extensions.description
- the textual description for the filterextensions
- the accepted file name extensionsjava.lang.IllegalArgumentException
- if the description of the filter is null
or empty;
if the extensions is null
, empty or contains an empty string