Package com.atlassian.jira.issue.fields
Class AbstractProgressBarSystemField
java.lang.Object
com.atlassian.jira.issue.fields.AbstractField
com.atlassian.jira.issue.fields.NavigableFieldImpl
com.atlassian.jira.issue.fields.AbstractProgressBarSystemField
- All Implemented Interfaces:
Field,NavigableField,RestAwareField,Comparable
- Direct Known Subclasses:
AggregateProgressBarSystemField,ProgressBarSystemField
public abstract class AbstractProgressBarSystemField
extends NavigableFieldImpl
implements RestAwareField
Base class for Progress Bar system fields.
- Since:
- v3.11
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprotected static class -
Field Summary
Fields inherited from class com.atlassian.jira.issue.fields.NavigableFieldImpl
applicationProperties, templatingEngineFields inherited from class com.atlassian.jira.issue.fields.AbstractField
authenticationContextFields inherited from interface com.atlassian.jira.issue.fields.NavigableField
ORDER_ASCENDING, ORDER_DESCENDING, TEMPLATE_DIRECTORY_PATH -
Constructor Summary
ConstructorsConstructorDescriptionAbstractProgressBarSystemField(String id, String nameKey, String columnHeadingKey, VelocityTemplatingEngine templatingEngine, ApplicationProperties applicationProperties, JiraAuthenticationContext authenticationContext) -
Method Summary
Modifier and TypeMethodDescriptionstatic LongcalculateProgressPercentage(Long spent, Long remainingEstimate) Calculates the progress as spent / (spent + remainingEstimate) if parameters are not null.getColumnViewHtml(FieldLayoutItem fieldLayoutItem, Map displayParams, Issue issue) protected abstract StringReturns the display id which is used by the progress-bar.vm template to generate ids for HTML tags.getFieldTypeInfo(FieldTypeInfoContext fieldTypeInfoContext) Returns lower level Information about the field.Returns the id of the field to check for visibility.getJsonFromIssue(Issue issue, boolean renderedVersionRequested, FieldLayoutItem fieldLayoutItem) Return a FieldJsonDataPair containing a json representation of the raw data for this field, and if required, a json representation of the rendered data for easy display.Return a description of the shape of this field when represented as JSON.protected abstract AbstractProgressBarSystemField.TimeTrackingParametersgetTimeTrackingGraphBeanParameters(Issue issue, I18nHelper helper) Methods inherited from class com.atlassian.jira.issue.fields.NavigableFieldImpl
getApplicationProperties, getColumnCssClass, getColumnHeadingKey, getDefaultSortOrder, getVelocityParams, prettyPrintChangeHistory, prettyPrintChangeHistory, renderTemplateMethods inherited from class com.atlassian.jira.issue.fields.AbstractField
compareTo, equals, getAuthenticationContext, getId, getName, getNameKey, hashCodeMethods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface java.lang.Comparable
compareToMethods inherited from interface com.atlassian.jira.issue.fields.Field
getId, getName, getNameKeyMethods inherited from interface com.atlassian.jira.issue.fields.NavigableField
getFieldSorts, getValueLoader, hasSortsDefined, prettyPrintChangeHistory
-
Constructor Details
-
AbstractProgressBarSystemField
public AbstractProgressBarSystemField(String id, String nameKey, String columnHeadingKey, VelocityTemplatingEngine templatingEngine, ApplicationProperties applicationProperties, JiraAuthenticationContext authenticationContext)
-
-
Method Details
-
getHiddenFieldId
Description copied from interface:NavigableFieldReturns the id of the field to check for visibility. For example, with original estimate field need to ensure that the timetracking field is not hidden. With most fields, this is the same as their id.- Specified by:
getHiddenFieldIdin interfaceNavigableField- Overrides:
getHiddenFieldIdin classNavigableFieldImpl
-
getColumnViewHtml
- Specified by:
getColumnViewHtmlin interfaceNavigableField
-
calculateProgressPercentage
Calculates the progress as spent / (spent + remainingEstimate) if parameters are not null. Returns 0 if spent was null, 100 if remainingEstimate was null, or null if both parameters were null or zeros.Throws an IllegalArgumentException if a negative number is passed in.
- Parameters:
spent- time spentremainingEstimate- remaining estimate- Returns:
- progress as a percentage, can return null
-
getTimeTrackingGraphBeanParameters
protected abstract AbstractProgressBarSystemField.TimeTrackingParameters getTimeTrackingGraphBeanParameters(Issue issue, I18nHelper helper) -
getDisplayId
Returns the display id which is used by the progress-bar.vm template to generate ids for HTML tags.- Returns:
- id unique for each field
-
getFieldTypeInfo
Description copied from interface:RestAwareFieldReturns lower level Information about the field. This information contains allowed values and/or the autocomplete url- Specified by:
getFieldTypeInfoin interfaceRestAwareField- Parameters:
fieldTypeInfoContext- theFieldTypeInfoContextcontains context information that is relevant to generate theFieldTypeInfo
-
getJsonSchema
Description copied from interface:RestAwareFieldReturn a description of the shape of this field when represented as JSON.- Specified by:
getJsonSchemain interfaceRestAwareField
-
getJsonFromIssue
public FieldJsonRepresentation getJsonFromIssue(Issue issue, boolean renderedVersionRequested, @Nullable FieldLayoutItem fieldLayoutItem) Description copied from interface:RestAwareFieldReturn a FieldJsonDataPair containing a json representation of the raw data for this field, and if required, a json representation of the rendered data for easy display.- Specified by:
getJsonFromIssuein interfaceRestAwareField- Parameters:
issue- to get field data fromrenderedVersionRequested- whether the use requested the return of rendered/pretty data as well as raw datafieldLayoutItem- field layout for this field. Will only be supplied if the field is also an ordereable field.- Returns:
- FieldJsonDataPair containing a json representation of the raw data for this field, and if required, a json representation of the rendered data for easy display.
-