|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.atlassian.jira.issue.customfields.impl.AbstractCustomFieldType com.atlassian.jira.issue.customfields.impl.AbstractMultiSettableCFType com.atlassian.jira.issue.customfields.impl.CascadingSelectCFType
public class CascadingSelectCFType
Cascading Select Custom Field Type allows for multiple dependent select lists.
CustomFieldParams
The key in the CustomFieldParams object represents the field depth of the
select list. eg. a key of null is the root parent, and key of "1" is the first level select list. As at JIRA 3.0,
there can only be one level.Option
Nested Class Summary | |
---|---|
static interface |
CascadingSelectCFType.Visitor<T>
|
Nested classes/interfaces inherited from class com.atlassian.jira.issue.customfields.impl.AbstractCustomFieldType |
---|
AbstractCustomFieldType.VisitorBase<T> |
Field Summary | |
---|---|
static PersistenceFieldType |
CASCADE_VALUE_TYPE
|
static java.lang.String |
CHILD_KEY
|
static java.lang.String |
PARENT_KEY
|
Fields inherited from class com.atlassian.jira.issue.customfields.impl.AbstractMultiSettableCFType |
---|
customFieldValuePersister, genericConfigManager, optionsManager |
Fields inherited from interface com.atlassian.jira.issue.customfields.CustomFieldType |
---|
DEFAULT_VALUE_TYPE |
Constructor Summary | |
---|---|
CascadingSelectCFType(OptionsManager optionsManager,
CustomFieldValuePersister customFieldValuePersister,
GenericConfigManager genericConfigManager)
|
Method Summary | |
---|---|
java.lang.Object |
accept(AbstractCustomFieldType.VisitorBase visitor)
|
int |
compare(java.lang.Object o1,
java.lang.Object o2,
FieldConfig fieldConfig)
Compares the two custom field objects. |
int |
compareOption(Option option1,
Option option2)
|
void |
createValue(CustomField field,
Issue issue,
java.lang.Object value)
Create a cascading select-list instance for an issue. |
java.lang.String |
getChangelogValue(CustomField field,
java.lang.Object value)
Returns a values to be stored in the change log, example is the id of the changed item. |
java.util.List |
getConfigurationItemTypes()
Returns a List of FieldConfigItemType objects. |
java.lang.Object |
getDefaultValue(FieldConfig fieldConfig)
Retrieves the Object representing the default CustomField value for the Custom Field. |
java.util.Set |
getIssueIdsWithValue(CustomField field,
Option option)
Returns a list of Issue Ids matching the "value" note that the value in this instance is the single object |
ProjectCustomFieldImporter |
getProjectImporter()
Returns the object that will perform the actual project import functions for the custom field type. |
java.lang.Object |
getSingularObjectFromString(java.lang.String string)
Returns a Singular Object, given the string value as passed by the presentation tier. |
java.lang.String |
getStringFromSingularObject(java.lang.Object optionObject)
Returns the String representation of a single value within the CustomFieldType. |
java.lang.Object |
getStringValueFromCustomFieldParams(CustomFieldParams parameters)
Return the String value object from the CustomFieldParams. |
java.lang.Object |
getValueFromCustomFieldParams(CustomFieldParams relevantParams)
Retrieves the Object representing the CustomField value instance from the CustomFieldParams of Strings. |
java.lang.Object |
getValueFromIssue(CustomField field,
Issue issue)
Retrieves the Object representing the current CustomField value for the given issue. |
java.util.Map |
getVelocityParameters(Issue issue,
CustomField field,
FieldLayoutItem fieldLayoutItem)
The custom field may wish to pass parameters to the velocity context beyond the getValueFromIssue methods (eg managers). |
void |
removeValue(CustomField field,
Issue issue,
Option option)
|
void |
setDefaultValue(FieldConfig fieldConfig,
java.lang.Object value)
Sets the default value for a Custom Field |
void |
updateValue(CustomField field,
Issue issue,
java.lang.Object value)
|
void |
validateFromParams(CustomFieldParams relevantParams,
ErrorCollection errorCollectionToAddTo,
FieldConfig config)
Ensures that the CustomFieldParams of Strings is a valid representation of the Custom Field values. |
Methods inherited from class com.atlassian.jira.issue.customfields.impl.AbstractMultiSettableCFType |
---|
getOptions, remove |
Methods inherited from class com.atlassian.jira.issue.customfields.impl.AbstractCustomFieldType |
---|
assertObjectImplementsType, availableForBulkEdit, getChangelogString, getDescription, getDescriptor, getI18nBean, getKey, getName, getRelatedIndexers, getVelocityParameters, init, isRenderable, valuesEqual |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface com.atlassian.jira.issue.customfields.MultipleCustomFieldType |
---|
getOptions |
Methods inherited from interface com.atlassian.jira.issue.customfields.CustomFieldType |
---|
availableForBulkEdit, getChangelogString, getDescription, getDescriptor, getKey, getName, getRelatedIndexers, init, isRenderable, remove, valuesEqual |
Field Detail |
---|
public static final java.lang.String PARENT_KEY
public static final java.lang.String CHILD_KEY
public static final PersistenceFieldType CASCADE_VALUE_TYPE
Constructor Detail |
---|
public CascadingSelectCFType(OptionsManager optionsManager, CustomFieldValuePersister customFieldValuePersister, GenericConfigManager genericConfigManager)
Method Detail |
---|
public void validateFromParams(CustomFieldParams relevantParams, ErrorCollection errorCollectionToAddTo, FieldConfig config)
CustomFieldType
CustomFieldParams
of Strings is a valid representation of the Custom Field values.
Any errors should be added to the ErrorCollection
under the appropriate key as required.
validateFromParams
in interface CustomFieldType
relevantParams
- parameter object of StringserrorCollectionToAddTo
- errorCollection to which any erros should be added (never null)config
- FieldConfigpublic void createValue(CustomField field, Issue issue, java.lang.Object value)
createValue
in interface CustomFieldType
value
- Must be a CustomFieldParams
, or the method has no effect.public void updateValue(CustomField field, Issue issue, java.lang.Object value)
updateValue
in interface CustomFieldType
public void removeValue(CustomField field, Issue issue, Option option)
removeValue
in interface MultipleSettableCustomFieldType
public java.lang.Object getValueFromIssue(CustomField field, Issue issue)
CustomFieldType
CustomFieldType.getValueFromCustomFieldParams(com.atlassian.jira.issue.customfields.view.CustomFieldParams)
for more detailed notes.
getValueFromIssue
in interface CustomFieldType
field
- Custom field for which to retrieve the valueissue
- Issue from which to retrieve the value
CustomFieldType.createValue(com.atlassian.jira.issue.fields.CustomField, com.atlassian.jira.issue.Issue, java.lang.Object)
, CustomFieldType.updateValue(com.atlassian.jira.issue.fields.CustomField, com.atlassian.jira.issue.Issue, java.lang.Object)
CustomFieldType.getValueFromCustomFieldParams(com.atlassian.jira.issue.customfields.view.CustomFieldParams)
public java.lang.Object getValueFromCustomFieldParams(CustomFieldParams relevantParams) throws FieldValidationException
CustomFieldType
CustomFieldType.createValue(com.atlassian.jira.issue.fields.CustomField, com.atlassian.jira.issue.Issue, java.lang.Object)
, CustomFieldType.updateValue(com.atlassian.jira.issue.fields.CustomField, com.atlassian.jira.issue.Issue, java.lang.Object)
) and Object returned from CustomFieldType.getValueFromIssue(com.atlassian.jira.issue.fields.CustomField, com.atlassian.jira.issue.Issue)
.
getValueFromCustomFieldParams
in interface CustomFieldType
relevantParams
- CustomFieldParams of String objects. Will contain one value for Singular field types.
CustomFieldType.createValue(com.atlassian.jira.issue.fields.CustomField, com.atlassian.jira.issue.Issue, java.lang.Object)
, CustomFieldType.updateValue(com.atlassian.jira.issue.fields.CustomField, com.atlassian.jira.issue.Issue, java.lang.Object)
FieldValidationException
- if the String value fails to convert into ObjectsCustomFieldType.createValue(com.atlassian.jira.issue.fields.CustomField, com.atlassian.jira.issue.Issue, java.lang.Object)
,
CustomFieldType.updateValue(com.atlassian.jira.issue.fields.CustomField, com.atlassian.jira.issue.Issue, java.lang.Object)
,
CustomFieldType.getValueFromIssue(com.atlassian.jira.issue.fields.CustomField, com.atlassian.jira.issue.Issue)
public java.lang.Object getStringValueFromCustomFieldParams(CustomFieldParams parameters)
CustomFieldType
getStringValueFromCustomFieldParams
in interface CustomFieldType
parameters
- - CustomFieldParams containing String values
public java.lang.Object getDefaultValue(FieldConfig fieldConfig)
CustomFieldType
CustomFieldType.getValueFromCustomFieldParams(com.atlassian.jira.issue.customfields.view.CustomFieldParams)
for more detailed notes.
getDefaultValue
in interface CustomFieldType
fieldConfig
- CustomField for default value
CustomFieldType.createValue(com.atlassian.jira.issue.fields.CustomField, com.atlassian.jira.issue.Issue, java.lang.Object)
, CustomFieldType.updateValue(com.atlassian.jira.issue.fields.CustomField, com.atlassian.jira.issue.Issue, java.lang.Object)
public void setDefaultValue(FieldConfig fieldConfig, java.lang.Object value)
CustomFieldType
setDefaultValue
in interface CustomFieldType
fieldConfig
- CustomField for which the default is being storedvalue
- Transport Object representing the value instance of the CustomFieldpublic java.lang.String getChangelogValue(CustomField field, java.lang.Object value)
CustomFieldType
getChangelogValue
in interface CustomFieldType
field
- CustomField that the value belongs tovalue
- Transport Object representing the value instance of the CustomField
public java.util.Set getIssueIdsWithValue(CustomField field, Option option)
getIssueIdsWithValue
in interface MultipleSettableCustomFieldType
field
- option
-
public java.lang.String getStringFromSingularObject(java.lang.Object optionObject)
CustomFieldType
String
representation of a single value within the CustomFieldType. This is the value that
will is passed to the presentation tier for editing. For single CustomFieldTypes the Singular Object is
the same as a Transport Object. However, for multi-dimensional CustomFieldTypes, the Singular Object is
the Object contained within the Collection
or CustomFieldParams
getStringFromSingularObject
in interface CustomFieldType
optionObject
- the object
public java.lang.Object getSingularObjectFromString(java.lang.String string) throws FieldValidationException
CustomFieldType
getSingularObjectFromString
in interface CustomFieldType
string
- the String
FieldValidationException
- if the string is an invalid representation of the Object.public java.util.List getConfigurationItemTypes()
CustomFieldType
FieldConfigItemType
objects.
This opens up possibilties for configurable custom fields
getConfigurationItemTypes
in interface CustomFieldType
getConfigurationItemTypes
in class AbstractCustomFieldType
FieldConfigItemType
public java.util.Map getVelocityParameters(Issue issue, CustomField field, FieldLayoutItem fieldLayoutItem)
CustomFieldType
getVelocityParameters
in interface CustomFieldType
getVelocityParameters
in class AbstractCustomFieldType
issue
- The issue currently in context (Note: this will be null in cases like 'default value')field
- CustomFieldfieldLayoutItem
- FieldLayoutItem
Map
of parameters to add to the velocity context, or an empty Map otherwise (never null)public int compare(java.lang.Object o1, java.lang.Object o2, FieldConfig fieldConfig)
SortableCustomField
compare
in interface SortableCustomField
o1
- Never nullo2
- Never null
public int compareOption(Option option1, Option option2)
public ProjectCustomFieldImporter getProjectImporter()
ProjectImportableCustomField
getProjectImporter
in interface ProjectImportableCustomField
public java.lang.Object accept(AbstractCustomFieldType.VisitorBase visitor)
accept
in class AbstractCustomFieldType
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |