Package org.biouno.unochoice
Class AbstractUnoChoiceParameter
- java.lang.Object
-
- hudson.model.ParameterDefinition
-
- hudson.model.SimpleParameterDefinition
-
- org.biouno.unochoice.AbstractUnoChoiceParameter
-
- All Implemented Interfaces:
ExtensionPoint
,Describable<ParameterDefinition>
,Serializable
,UnoChoiceParameter
- Direct Known Subclasses:
AbstractScriptableParameter
public abstract class AbstractUnoChoiceParameter extends SimpleParameterDefinition implements UnoChoiceParameter
Abstract Uno Choice parameter. Provides basic methods common to all Uno Choice parameters.- Since:
- 0.20
- Author:
- Bruno P. Kinoshita
- See Also:
- Serialized Form
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class hudson.model.ParameterDefinition
ParameterDefinition.ParameterDescriptor
-
Nested classes/interfaces inherited from interface hudson.ExtensionPoint
ExtensionPoint.LegacyInstancesAreScopedToHudson
-
-
Field Summary
Fields Modifier and Type Field Description static int
DEFAULT_MAX_VISIBLE_ITEM_COUNT
static String
ELEMENT_TYPE_FORMATTED_HIDDEN_HTML
static String
ELEMENT_TYPE_FORMATTED_HTML
static String
ELEMENT_TYPE_ORDERED_LIST
static String
ELEMENT_TYPE_TEXT_BOX
static String
ELEMENT_TYPE_UNORDERED_LIST
protected static Logger
LOGGER
static String
PARAMETER_TYPE_CHECK_BOX
static String
PARAMETER_TYPE_MULTI_SELECT
static String
PARAMETER_TYPE_RADIO
static String
PARAMETER_TYPE_SINGLE_SELECT
-
Fields inherited from class hudson.model.ParameterDefinition
LIST
-
-
Constructor Summary
Constructors Modifier Constructor Description protected
AbstractUnoChoiceParameter(String name, String description)
Deprecated.to fix JENKINS-32149 (create random name only once - this is the parameter ID)protected
AbstractUnoChoiceParameter(String name, String description, String randomName)
Inherited constructor.
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description static DescriptorExtensionList<ParameterDefinition,ParameterDefinition.ParameterDescriptor>
all()
ParameterValue
createValue(String value)
ParameterValue
createValue(org.kohsuke.stapler.StaplerRequest request, net.sf.json.JSONObject json)
abstract String
getChoiceType()
Gets the choice type.ParameterDefinition.ParameterDescriptor
getDescriptor()
String
getRandomName()
Gets the randomly generated parameter name.-
Methods inherited from class hudson.model.SimpleParameterDefinition
createValue, createValue
-
Methods inherited from class hudson.model.ParameterDefinition
copyWithDefaultValue, getDefaultParameterValue, getDescription, getFormattedDescription, getName, getType
-
-
-
-
Field Detail
-
LOGGER
protected static final Logger LOGGER
-
PARAMETER_TYPE_SINGLE_SELECT
public static final String PARAMETER_TYPE_SINGLE_SELECT
- See Also:
- Constant Field Values
-
PARAMETER_TYPE_MULTI_SELECT
public static final String PARAMETER_TYPE_MULTI_SELECT
- See Also:
- Constant Field Values
-
PARAMETER_TYPE_CHECK_BOX
public static final String PARAMETER_TYPE_CHECK_BOX
- See Also:
- Constant Field Values
-
PARAMETER_TYPE_RADIO
public static final String PARAMETER_TYPE_RADIO
- See Also:
- Constant Field Values
-
ELEMENT_TYPE_TEXT_BOX
public static final String ELEMENT_TYPE_TEXT_BOX
- See Also:
- Constant Field Values
-
ELEMENT_TYPE_ORDERED_LIST
public static final String ELEMENT_TYPE_ORDERED_LIST
- See Also:
- Constant Field Values
-
ELEMENT_TYPE_UNORDERED_LIST
public static final String ELEMENT_TYPE_UNORDERED_LIST
- See Also:
- Constant Field Values
-
ELEMENT_TYPE_FORMATTED_HTML
public static final String ELEMENT_TYPE_FORMATTED_HTML
- See Also:
- Constant Field Values
-
ELEMENT_TYPE_FORMATTED_HIDDEN_HTML
public static final String ELEMENT_TYPE_FORMATTED_HIDDEN_HTML
- See Also:
- Constant Field Values
-
DEFAULT_MAX_VISIBLE_ITEM_COUNT
public static final int DEFAULT_MAX_VISIBLE_ITEM_COUNT
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
AbstractUnoChoiceParameter
protected AbstractUnoChoiceParameter(String name, String description)
Deprecated.to fix JENKINS-32149 (create random name only once - this is the parameter ID)Inherited constructor. .- Parameters:
name
- namedescription
- description FIXME: remove in new major release
-
AbstractUnoChoiceParameter
protected AbstractUnoChoiceParameter(String name, String description, String randomName)
Inherited constructor. .- Parameters:
name
- namedescription
- descriptionrandomName
- the parameter unique ID (a random uuid) created once per parameter. If blank ornull
it will be created a new random parameter name that starts with choice-parameter
-
-
Method Detail
-
getRandomName
public String getRandomName()
Gets the randomly generated parameter name. Used in the UI for objecting binding.- Returns:
- a random string, created during object instantiation.
-
createValue
public ParameterValue createValue(String value)
- Specified by:
createValue
in classSimpleParameterDefinition
-
createValue
public ParameterValue createValue(org.kohsuke.stapler.StaplerRequest request, net.sf.json.JSONObject json)
- Specified by:
createValue
in classParameterDefinition
-
getChoiceType
public abstract String getChoiceType()
Gets the choice type.
This method can be called from Javascript
- Returns:
- choice type
-
getDescriptor
public ParameterDefinition.ParameterDescriptor getDescriptor()
- Specified by:
getDescriptor
in interfaceDescribable<ParameterDefinition>
- Overrides:
getDescriptor
in classParameterDefinition
-
all
public static DescriptorExtensionList<ParameterDefinition,ParameterDefinition.ParameterDescriptor> all()
-
-