public abstract class

AbstractProgressBarSystemField

extends NavigableFieldImpl
implements RestAwareField
java.lang.Object
   ↳ com.atlassian.jira.issue.fields.AbstractField
     ↳ com.atlassian.jira.issue.fields.NavigableFieldImpl
       ↳ com.atlassian.jira.issue.fields.AbstractProgressBarSystemField
Known Direct Subclasses

Class Overview

Base class for Progress Bar system fields.

Summary

Nested Classes
class AbstractProgressBarSystemField.TimeTrackingParameters  
[Expand]
Inherited Constants
From interface com.atlassian.jira.issue.fields.NavigableField
[Expand]
Inherited Fields
From class com.atlassian.jira.issue.fields.NavigableFieldImpl
From class com.atlassian.jira.issue.fields.AbstractField
Public Constructors
AbstractProgressBarSystemField(String id, String nameKey, String columnHeadingKey, VelocityTemplatingEngine templatingEngine, ApplicationProperties applicationProperties, JiraAuthenticationContext authenticationContext)
Public Methods
static Long calculateProgressPercentage(Long spent, Long remainingEstimate)
Calculates the progress as spent / (spent + remainingEstimate) if parameters are not null.
String getColumnViewHtml(FieldLayoutItem fieldLayoutItem, Map displayParams, Issue issue)
FieldTypeInfo getFieldTypeInfo(FieldTypeInfoContext fieldTypeInfoContext)
Returns lower level Information about the field.
String getHiddenFieldId()
Returns the id of the field to check for visibility.
FieldJsonRepresentation 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.
JsonType getJsonSchema()
Return a description of the shape of this field when represented as JSON.
Protected Methods
abstract String getDisplayId()
Returns the display id which is used by the progress-bar.vm template to generate ids for HTML tags.
abstract AbstractProgressBarSystemField.TimeTrackingParameters getTimeTrackingGraphBeanParameters(Issue issue, I18nHelper helper)
[Expand]
Inherited Methods
From class com.atlassian.jira.issue.fields.NavigableFieldImpl
From class com.atlassian.jira.issue.fields.AbstractField
From class java.lang.Object
From interface com.atlassian.jira.issue.fields.Field
From interface com.atlassian.jira.issue.fields.NavigableField
From interface com.atlassian.jira.issue.fields.rest.RestAwareField
From interface java.lang.Comparable

Public Constructors

public AbstractProgressBarSystemField (String id, String nameKey, String columnHeadingKey, VelocityTemplatingEngine templatingEngine, ApplicationProperties applicationProperties, JiraAuthenticationContext authenticationContext)

Public Methods

public static Long calculateProgressPercentage (Long spent, Long remainingEstimate)

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 spent
remainingEstimate remaining estimate
Returns
  • progress as a percentage, can return null

public String getColumnViewHtml (FieldLayoutItem fieldLayoutItem, Map displayParams, Issue issue)

public FieldTypeInfo getFieldTypeInfo (FieldTypeInfoContext fieldTypeInfoContext)

Returns lower level Information about the field. This information contains allowed values and/or the autocomplete url

Parameters
fieldTypeInfoContext the FieldTypeInfoContext contains context information that is relevant to generate the FieldTypeInfo

public String getHiddenFieldId ()

Returns 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.

public FieldJsonRepresentation 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.

Parameters
issue to get field data from
renderedVersionRequested whether the use requested the return of rendered/pretty data as well as raw data
fieldLayoutItem 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.

public JsonType getJsonSchema ()

Return a description of the shape of this field when represented as JSON.

Protected Methods

protected abstract String 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

protected abstract AbstractProgressBarSystemField.TimeTrackingParameters getTimeTrackingGraphBeanParameters (Issue issue, I18nHelper helper)