public class FileParameterModel extends ParameterModel
Modifier and Type | Field and Description |
---|---|
protected java.util.List<java.lang.String> |
allowedExtensionLabels |
protected java.util.List<java.lang.String> |
allowedExtensions |
Constructor and Description |
---|
FileParameterModel(IModuleUserConfiguration conf,
java.lang.String name,
java.lang.String label,
java.lang.String description,
java.lang.String defaultValue) |
Modifier and Type | Method and Description |
---|---|
void |
addAllowedExtension(java.lang.String extension,
java.lang.String label)
Add one file extension filter with its label which a dialog will use
to filter the files it shows to the argument.
|
void |
addAllowedExtensions(java.lang.String[] extensions,
java.lang.String[] labels)
Add file extension filters with their labels which a dialog will use
to filter the files it shows to the user.
|
java.lang.String[] |
getAllowedExtensionLabels() |
java.lang.String[] |
getAllowedExtensions() |
getDefaultValue, getDescription, getLabel, getName, getStringValue, isLocked, setValue
protected java.util.List<java.lang.String> allowedExtensions
protected java.util.List<java.lang.String> allowedExtensionLabels
public FileParameterModel(IModuleUserConfiguration conf, java.lang.String name, java.lang.String label, java.lang.String description, java.lang.String defaultValue)
public java.lang.String[] getAllowedExtensions()
public java.lang.String[] getAllowedExtensionLabels()
public void addAllowedExtensions(java.lang.String[] extensions, java.lang.String[] labels)
The extensions are platform specific. For example, on some platforms, an extension filter string is typically of the form "*.extension", where "*.*" matches all files. For filters with multiple extensions, use semicolon as a separator, e.g. "*.jpg;*.png".
Each label is a user-friendly short description shown for its corresponding filter. The names array must be the same length as the extensions array.
extensions
- the allowed file extension filterlabels
- the corresponding label for each extensionpublic void addAllowedExtension(java.lang.String extension, java.lang.String label)
The extension filter is platform specific. For example, on some platforms, an extension filter string is typically of the form "*.extension", where "*.*" matches all files. For filters with multiple extensions, use semicolon as a separator, e.g. "*.jpg;*.png".
The label is a user-friendly short description shown for its corresponding filter. The names array must be the same length as the extensions array.
extension
- the allowed file extension filterlabel
- the corresponding label