protected class CommandSkeletonService.CommandTemplateInputPicker extends Object implements PluginInputPicker
Modifier and Type | Field and Description |
---|---|
private CommandTemplate |
ct |
Constructor and Description |
---|
CommandTemplateInputPicker(CommandTemplate ct) |
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 |
setHelpPath(String helpPath,
HelpLoader helpLoader)
Register the documentation path for this plugin.
|
private final CommandTemplate ct
public CommandTemplateInputPicker(CommandTemplate ct)
public 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.