public class PluginOutputMatcher extends Object implements PluginOutputPicker
PluginOutputPicker
.
No run-time user input is accepted. To register a handling choice
for an output parameter, call saveOutputValue
or
saveOutputFile
prior to passing the PluginOutputMatcher instance
to the SlideSetPluginLoader
.
If no handling choice is selected for an output, the default will be used.Modifier and Type | Field and Description |
---|---|
private HashMap<String,String> |
customLinkDirs |
private HashMap<String,String> |
customLinkExts |
private HashMap<String,String> |
customLinkPres |
private HashMap<String,String> |
customTypes |
private ArrayList<String> |
linkDir |
private ArrayList<String> |
linkExt |
private ArrayList<String> |
linkPre |
private ArrayList<Integer> |
outputChoices |
private ArrayList<String> |
savedParentFields |
private ArrayList<Integer> |
selectedParentFields |
Constructor and Description |
---|
PluginOutputMatcher() |
Modifier and Type | Method and Description |
---|---|
void |
addOutput(String label,
String[] choices,
boolean[] link,
String[] linkDir,
String[] linkPre,
String[] linkExt)
Register a plugin output and available
options for handling its value.
|
void |
getOutputChoices(ArrayList<Integer> outputChoices,
ArrayList<Integer> selectedParentFields,
ArrayList<String> linkDir,
ArrayList<String> linkPre,
ArrayList<String> linkExt)
Get chosen options for handling of each plugin output
value, as well as fields from the parent table
that should be copied to the results table.
|
void |
saveOutputFile(String label,
String type,
String linkDir,
String linkPre,
String linkExt)
Register an output to be saved as a file link.
|
void |
saveOutputValue(String label,
String type)
Register an output to be saved directly in the result table.
|
void |
saveParentField(String label)
Register a parent field to be copied to the result table
|
void |
setParentFieldLabels(String[] labels)
Register fields from the parent table that
are available for copying to the results table.
|
public void saveOutputValue(String label, String type)
label
- - Output parameter annotation labeltype
- - Type name (ex. Text)public void saveOutputFile(String label, String type, String linkDir, String linkPre, String linkExt)
label
- - Output parameter annotation labeltype
- - Type name (ex. "Image file", "SVG file")linkDir
- - File directory (null for default)linkPre
- - File name prefix (null for default)linkExt
- - File extension (null for default)public void saveParentField(String label)
label
- - Name of the parent field (column) to savepublic void addOutput(String label, String[] choices, boolean[] link, String[] linkDir, String[] linkPre, String[] linkExt)
PluginOutputPicker
addOutput
in interface PluginOutputPicker
label
- Human-readable name of the output,
i.e. for labeling a drop-down box.
choices
- Human-readable names for each
available option for handling the output value.
link
- Indicator for an output handling option
that should be treated as a file link, and will
require values for the link path, file name
prefix, and file extension.
linkDir
- Default path used to write output
data for output handling options using file
links (ignored for others). May be null
,
in which case this PluginOutputPicker
will determine the default.
linkPre
- Default file prefix used to write output
data for output handling options using file
links (ignored for others). May be null
,
in which case this PluginOutputPicker
will determine the default.
linkExt
- Default file extension used to write
output data for output handling options using file
links (ignored for others). May be null
,
in which case this PluginOutputPicker
will determine the default.public void setParentFieldLabels(String[] labels)
PluginOutputPicker
setParentFieldLabels
in interface PluginOutputPicker
labels
- Human-readable names for the fields.public void getOutputChoices(ArrayList<Integer> outputChoices, ArrayList<Integer> selectedParentFields, ArrayList<String> linkDir, ArrayList<String> linkPre, ArrayList<String> linkExt) throws OperationCanceledException
PluginOutputPicker
getOutputChoices
in interface PluginOutputPicker
outputChoices
- Empty list to be filled with index
values of the selected output handling methods. The order of
values corresponds to the order in which the plugin
outputs were registered through addOutput
.
The values correspond to the indeces of the selected
option in the choices
array passed to addOutput
.
selectedParentFields
- Empty list to be filled with
index values of the fields from the parent table that
have been selected for copying to the results table.
Values correspond to the indeces of selected fields
in the labels
array passed to
setParentFieldLabels
.
linkDir
- Empty list to be filled with default paths
to be used to write output data, or null
if
the selected plugin output handling method does not
require a file link.
linkPre
- Empty list to be filled with default file
prefixes to be used to write output data, or null
if
the selected plugin output handling method does not
require a file link.
linkExt
- Empty list to be filled with default file
extensions to be used to write output data, or null
if
the selected plugin output handling method does not
require a file link.OperationCanceledException
- If the user aborts
the plugin, for example, by dismissing a dialog box
without making the required selections.Copyright © 2023. All rights reserved.