Class TextareaChoiceListProvider
java.lang.Object
hudson.model.AbstractDescribableImpl<ChoiceListProvider>
jp.ikedam.jenkins.plugins.extensible_choice_parameter.ChoiceListProvider
jp.ikedam.jenkins.plugins.extensible_choice_parameter.AddEditedChoiceListProvider
jp.ikedam.jenkins.plugins.extensible_choice_parameter.TextareaChoiceListProvider
- All Implemented Interfaces:
ExtensionPoint
,Describable<ChoiceListProvider>
,Serializable
A choice provider whose choices are defined as a text, like the build-in choice parameter.
- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic class
The internal class to work with views.Nested classes/interfaces inherited from class jp.ikedam.jenkins.plugins.extensible_choice_parameter.AddEditedChoiceListProvider
AddEditedChoiceListProvider.WhenToAdd
Nested classes/interfaces inherited from interface hudson.ExtensionPoint
ExtensionPoint.LegacyInstancesAreScopedToHudson
-
Constructor Summary
ConstructorsConstructorDescriptionTextareaChoiceListProvider
(String choiceListText, String defaultChoice, boolean addEditedValue, AddEditedChoiceListProvider.WhenToAdd whenToAdd) Constructor instantiating with parameters in the configuration page. -
Method Summary
Modifier and TypeMethodDescriptionprotected void
addEditedValue
(AbstractProject<?, ?> project, ExtensibleChoiceParameterDefinition def, String value) Called to add a edited value to the choice list.Returns the list of choices the user specified in the job configuration page.The list of choices, joined into a string.Returns the default choice.boolean
Checks if accessChoiceListProvider.getChoiceList()
from REST API needs theItem.BUILD
permission.protected void
setChoiceList
(List<String> choiceList) Methods inherited from class jp.ikedam.jenkins.plugins.extensible_choice_parameter.AddEditedChoiceListProvider
getWhenToAdd, isAddEditedValue, onBuildCompletedWithValue, onBuildTriggeredWithValue
Methods inherited from class jp.ikedam.jenkins.plugins.extensible_choice_parameter.ChoiceListProvider
all
Methods inherited from class hudson.model.AbstractDescribableImpl
getDescriptor
-
Constructor Details
-
TextareaChoiceListProvider
@DataBoundConstructor public TextareaChoiceListProvider(String choiceListText, String defaultChoice, boolean addEditedValue, AddEditedChoiceListProvider.WhenToAdd whenToAdd) Constructor instantiating with parameters in the configuration page. When instantiating from the saved configuration, the object is directly serialized with XStream, and no constructor is used.- Parameters:
choiceListText
- the text where choices are written in each line.defaultChoice
-addEditedValue
-whenToAdd
-
-
-
Method Details
-
getChoiceList
Returns the list of choices the user specified in the job configuration page.- Specified by:
getChoiceList
in classChoiceListProvider
- Returns:
- the list of choices.
- See Also:
-
setChoiceList
- Parameters:
choiceList
- the choiceList to set
-
getChoiceListText
The list of choices, joined into a string. Used for filling a field when the configuration page is shown.- Returns:
- Joined choices.
-
getDefaultChoice
Returns the default choice.- Overrides:
getDefaultChoice
in classChoiceListProvider
- Returns:
- the default choice
- See Also:
-
requiresBuildPermission
public boolean requiresBuildPermission()Description copied from class:ChoiceListProvider
Checks if accessChoiceListProvider.getChoiceList()
from REST API needs theItem.BUILD
permission. If true this will currently return the choices only for Job based API calls.- Overrides:
requiresBuildPermission
in classChoiceListProvider
- Returns:
- true if allow access to choices only if BUILD permission was granted. false otherwise.
-
addEditedValue
protected void addEditedValue(AbstractProject<?, ?> project, ExtensibleChoiceParameterDefinition def, String value) Description copied from class:AddEditedChoiceListProvider
Called to add a edited value to the choice list.- Specified by:
addEditedValue
in classAddEditedChoiceListProvider
-