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
public class TextareaChoiceListProvider extends AddEditedChoiceListProvider
A choice provider whose choices are defined as a text, like the build-in choice parameter.- See Also:
- Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
TextareaChoiceListProvider.DescriptorImpl
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
Constructors Constructor Description TextareaChoiceListProvider(String choiceListText, String defaultChoice, boolean addEditedValue, AddEditedChoiceListProvider.WhenToAdd whenToAdd)
Constructor instantiating with parameters in the configuration page.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected void
addEditedValue(AbstractProject<?,?> project, ExtensibleChoiceParameterDefinition def, String value)
Called to add a edited value to the choice list.List<String>
getChoiceList()
Returns the list of choices the user specified in the job configuration page.String
getChoiceListText()
The list of choices, joined into a string.String
getDefaultChoice()
Returns the default choice.boolean
requiresBuildPermission()
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 Detail
-
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 Detail
-
getChoiceList
public List<String> 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:
ChoiceListProvider.getChoiceList()
-
setChoiceList
protected void setChoiceList(List<String> choiceList)
- Parameters:
choiceList
- the choiceList to set
-
getChoiceListText
public String getChoiceListText()
The list of choices, joined into a string. Used for filling a field when the configuration page is shown.- Returns:
- Joined choices.
-
getDefaultChoice
public String getDefaultChoice()
Returns the default choice.- Overrides:
getDefaultChoice
in classChoiceListProvider
- Returns:
- the default choice
- See Also:
ChoiceListProvider.getDefaultChoice()
-
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
-
-