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, Comparable
- Direct Known Subclasses:
- AggregateProgressBarSystemField, ProgressBarSystemField
public abstract class AbstractProgressBarSystemField
- extends NavigableFieldImpl
Base class for Progress Bar system fields.
- Since:
- v3.11
jiraDurationUtils
protected final JiraDurationUtils jiraDurationUtils
AbstractProgressBarSystemField
public AbstractProgressBarSystemField(String id,
String nameKey,
String columnHeadingKey,
com.atlassian.velocity.VelocityManager velocityManager,
ApplicationProperties applicationProperties,
JiraAuthenticationContext authenticationContext,
JiraDurationUtils jiraDurationUtils)
getHiddenFieldId
public String getHiddenFieldId()
- Description copied from interface:
NavigableField
- 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.
- Specified by:
getHiddenFieldId
in interface NavigableField
- Overrides:
getHiddenFieldId
in class NavigableFieldImpl
getColumnViewHtml
public String getColumnViewHtml(FieldLayoutItem fieldLayoutItem,
Map displayParams,
Issue issue)
calculateProgressPercentage
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 spentremainingEstimate
- remaining estimate
- Returns:
- progress as a percentage, can return null
getRemainingEstimate
protected abstract Long getRemainingEstimate(Issue issue)
getOriginalEstimate
protected abstract Long getOriginalEstimate(Issue issue)
getTimeSpent
protected abstract Long getTimeSpent(Issue issue)
getDisplayId
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
Copyright © 2002-2009 Atlassian. All Rights Reserved.