Package org.biouno.unochoice
Class CascadeChoiceParameter
-
- All Implemented Interfaces:
ExtensionPoint
,Describable<ParameterDefinition>
,Serializable
,CascadableParameter<Map<Object,Object>>
,ScriptableParameter<Map<Object,Object>>
,UnoChoiceParameter
public class CascadeChoiceParameter extends AbstractCascadableParameter
A choice parameter, that gets updated when another parameter changes. The simplest use case for this, would be having a list of states, and when the user selected a state it would trigger an update of the city fields.
The state parameter would be a choice parameter, and the city parameter would be a cascade choice parameter, that referenced the former.
Its options are retrieved from the evaluation of a Groovy script.
- Since:
- 0.1
- Author:
- Bruno P. Kinoshita
- See Also:
- Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
CascadeChoiceParameter.DescriptImpl
-
Nested classes/interfaces inherited from class hudson.model.ParameterDefinition
ParameterDefinition.ParameterDescriptor
-
Nested classes/interfaces inherited from interface hudson.ExtensionPoint
ExtensionPoint.LegacyInstancesAreScopedToHudson
-
-
Field Summary
-
Fields inherited from class org.biouno.unochoice.AbstractCascadableParameter
parameters
-
Fields inherited from class org.biouno.unochoice.AbstractScriptableParameter
EQUALS, JENKINS_BUILD_VARIABLE_NAME, JENKINS_PARAMETER_VARIABLE_NAME, JENKINS_PROJECT_VARIABLE_NAME, script, SEPARATOR
-
Fields inherited from class org.biouno.unochoice.AbstractUnoChoiceParameter
DEFAULT_MAX_VISIBLE_ITEM_COUNT, ELEMENT_TYPE_FORMATTED_HIDDEN_HTML, ELEMENT_TYPE_FORMATTED_HTML, ELEMENT_TYPE_ORDERED_LIST, ELEMENT_TYPE_TEXT_BOX, ELEMENT_TYPE_UNORDERED_LIST, LOGGER, PARAMETER_TYPE_CHECK_BOX, PARAMETER_TYPE_MULTI_SELECT, PARAMETER_TYPE_RADIO, PARAMETER_TYPE_SINGLE_SELECT
-
Fields inherited from class hudson.model.ParameterDefinition
LIST
-
-
Constructor Summary
Constructors Constructor Description CascadeChoiceParameter(String name, String description, String randomName, Script script, String choiceType, String referencedParameters, Boolean filterable)
Deprecated.see JENKINS-31625CascadeChoiceParameter(String name, String description, String randomName, Script script, String choiceType, String referencedParameters, Boolean filterable, Integer filterLength)
Constructor called from Jelly with parameters.CascadeChoiceParameter(String name, String description, Script script, String choiceType, String referencedParameters, Boolean filterable)
Deprecated.see JENKINS-32149
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description String
getChoiceType()
Gets the choice type.Boolean
getFilterable()
Get the filter flag.Integer
getFilterLength()
Get the filter length.-
Methods inherited from class org.biouno.unochoice.AbstractCascadableParameter
doUpdate, getChoicesForUI, getParameters, getReferencedParameters, getReferencedParametersAsArray
-
Methods inherited from class org.biouno.unochoice.AbstractScriptableParameter
getChoices, getChoices, getChoicesAsString, getChoicesAsString, getDefaultParameterValue, getScript, getVisibleItemCount
-
Methods inherited from class org.biouno.unochoice.AbstractUnoChoiceParameter
all, createValue, createValue, getDescriptor, getRandomName
-
Methods inherited from class hudson.model.SimpleParameterDefinition
createValue, createValue
-
Methods inherited from class hudson.model.ParameterDefinition
copyWithDefaultValue, getDescription, getFormattedDescription, getName, getType
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.biouno.unochoice.ScriptableParameter
getChoices
-
-
-
-
Constructor Detail
-
CascadeChoiceParameter
public CascadeChoiceParameter(String name, String description, Script script, String choiceType, String referencedParameters, Boolean filterable)
Deprecated.see JENKINS-32149Constructor called from Jelly with parameters.- Parameters:
name
- namedescription
- descriptionscript
- scriptchoiceType
- choice typereferencedParameters
- referenced parametersfilterable
- filter flag
-
CascadeChoiceParameter
public CascadeChoiceParameter(String name, String description, String randomName, Script script, String choiceType, String referencedParameters, Boolean filterable)
Deprecated.see JENKINS-31625Constructor called from Jelly with parameters.- Parameters:
name
- namedescription
- descriptionrandomName
- parameter random generated name (uuid)script
- scriptchoiceType
- choice typereferencedParameters
- referenced parametersfilterable
- filter flag
-
CascadeChoiceParameter
@DataBoundConstructor public CascadeChoiceParameter(String name, String description, String randomName, Script script, String choiceType, String referencedParameters, Boolean filterable, Integer filterLength)
Constructor called from Jelly with parameters.- Parameters:
name
- namedescription
- descriptionrandomName
- parameter random generated name (uuid)script
- scriptchoiceType
- choice typereferencedParameters
- referenced parametersfilterable
- filter flagfilterLength
- filter length
-
-
Method Detail
-
getChoiceType
public String getChoiceType()
Description copied from class:AbstractUnoChoiceParameter
Gets the choice type.
This method can be called from Javascript
- Specified by:
getChoiceType
in classAbstractUnoChoiceParameter
- Returns:
- choice type
-
getFilterable
public Boolean getFilterable()
Get the filter flag.- Returns:
- filter flag
-
getFilterLength
public Integer getFilterLength()
Get the filter length.- Returns:
- filter length
-
-