public class PluginInputMatcher extends Object implements PluginInputPicker
PluginInputPicker
.
No run-time user input is accepted. To register a handling choice for
an input parameter, call makeColumnChoice
or makeConstantChoice
prior to passing the PluginOutputMatcher instance
to the SlideSetPluginLoader
.
Note that a handling choice must be made for each input parameter (i.e. no
defaults will be used).Modifier and Type | Field and Description |
---|---|
private ArrayList<Integer> |
choices |
private HashMap<String,String> |
columnChoices |
private HashMap<String,String> |
constantChoices |
private ArrayList<String> |
constants |
Constructor and Description |
---|
PluginInputMatcher() |
Modifier and Type | Method and Description |
---|---|
void |
addInput(String label,
String[] choices,
Object[] constantRequest,
String[] acceptableValues)
Register a plugin input and the options
available for assigning its value.
|
void |
getInputChoices(ArrayList<Integer> inputChoices,
ArrayList<Object> constants)
Get chosen options for assignment of each plugin
input value.
|
void |
makeColumnChoice(String label,
String colName)
Register a column choice for a parameter
|
void |
makeConstantChoice(String label,
String typeName,
String value)
Register a constant for a parameter
|
void |
setHelpPath(String helpPath,
HelpLoader helpLoader)
Register the documentation path for this plugin.
|
public void makeColumnChoice(String label, String colName)
label
- - Label in the parameter annotationcolName
- - Name of the column to choosepublic void makeConstantChoice(String label, String typeName, String value)
label
- - Label in the parameter annotationtypeName
- - Value type (ex. Text, Logical, etc.)value
- - Constant value, as Stringpublic void addInput(String label, String[] choices, Object[] constantRequest, String[] acceptableValues)
PluginInputPicker
addInput
in interface PluginInputPicker
label
- Human-readable name of the input,
i.e. for labeling a drop-down box.
choices
- Human-readable names for each
available option for assigning the input value.
constantRequest
- If the corresponding option
for assigning the input value requires a
constant, the default value; otherwise, null
.
This array must have the same length as choices
.
acceptableValues
- List of acceptable String
values for this input parameter, or null
if
not applicable (i.e. no list of acceptable values, or
parameter does not take a String
value).public void setHelpPath(String helpPath, HelpLoader helpLoader)
PluginInputPicker
PluginInputPicker
may provide a way to display it. This method
may be called at any point before
getInputChoices()
.setHelpPath
in interface PluginInputPicker
helpPath
- Path specifying the documentation resource
associated with the plugin whose parameters are being assigned.helpLoader
- HelpLoader
which should be used to
view the documentation.public void getInputChoices(ArrayList<Integer> inputChoices, ArrayList<Object> constants) throws OperationCanceledException
PluginInputPicker
getInputChoices
in interface PluginInputPicker
inputChoices
- Empty list to be filled with index
values of the selected input sources. The order of
values corresponds to the order in which the plugin
inputs were registered through addInput
.
The values correspond to the indeces of the selected
option in the choices
array passed to addInput
.
constants
- Empty list to be filled with constant
values selected, or null
if no constant
value is required for the selected option.
OperationCanceledException
- If the user aborts
the plugin, for example, by dismissing a dialog box
without making the required selections.Copyright © 2023. All rights reserved.