com.atlassian.jira.issue.fields
Class AbstractProgressBarSystemField

java.lang.Object
  extended by com.atlassian.jira.issue.fields.AbstractField
      extended by com.atlassian.jira.issue.fields.NavigableFieldImpl
          extended by com.atlassian.jira.issue.fields.AbstractProgressBarSystemField
All Implemented Interfaces:
Field, NavigableField, java.lang.Comparable
Direct Known Subclasses:
AggregateProgressBarSystemField, ProgressBarSystemField

public abstract class AbstractProgressBarSystemField
extends NavigableFieldImpl

Base class for Progress Bar system fields.

Since:
v3.11

Nested Class Summary
protected static class AbstractProgressBarSystemField.TimeTrackingParameters
           
 
Field Summary
 
Fields inherited from class com.atlassian.jira.issue.fields.NavigableFieldImpl
applicationProperties, velocityManager
 
Fields inherited from class com.atlassian.jira.issue.fields.AbstractField
authenticationContext
 
Fields inherited from interface com.atlassian.jira.issue.fields.NavigableField
ORDER_ASCENDING, ORDER_DESCENDING, TEMPLATE_DIRECTORY_PATH
 
Constructor Summary
AbstractProgressBarSystemField(java.lang.String id, java.lang.String nameKey, java.lang.String columnHeadingKey, com.atlassian.velocity.VelocityManager velocityManager, ApplicationProperties applicationProperties, JiraAuthenticationContext authenticationContext)
           
 
Method Summary
static java.lang.Long calculateProgressPercentage(java.lang.Long spent, java.lang.Long remainingEstimate)
          Calculates the progress as spent / (spent + remainingEstimate) if parameters are not null.
 java.lang.String getColumnViewHtml(FieldLayoutItem fieldLayoutItem, java.util.Map displayParams, Issue issue)
           
protected abstract  java.lang.String getDisplayId()
          Returns the display id which is used by the progress-bar.vm template to generate ids for HTML tags.
 java.lang.String getHiddenFieldId()
          Returns the id of the field to check for visibility.
protected abstract  AbstractProgressBarSystemField.TimeTrackingParameters getTimeTrackingGraphBeanParameters(Issue issue, I18nHelper helper)
           
 
Methods inherited from class com.atlassian.jira.issue.fields.NavigableFieldImpl
getApplicationProperties, getColumnCssClass, getColumnHeadingKey, getDefaultSortOrder, getSortComparatorSource, getVelocityParams, prettyPrintChangeHistory, prettyPrintChangeHistory, renderTemplate
 
Methods inherited from class com.atlassian.jira.issue.fields.AbstractField
compareTo, equals, getAuthenticationContext, getId, getName, getNameKey, hashCode
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface com.atlassian.jira.issue.fields.NavigableField
getSorter
 
Methods inherited from interface com.atlassian.jira.issue.fields.Field
getId, getName, getNameKey
 
Methods inherited from interface java.lang.Comparable
compareTo
 

Constructor Detail

AbstractProgressBarSystemField

public AbstractProgressBarSystemField(java.lang.String id,
                                      java.lang.String nameKey,
                                      java.lang.String columnHeadingKey,
                                      com.atlassian.velocity.VelocityManager velocityManager,
                                      ApplicationProperties applicationProperties,
                                      JiraAuthenticationContext authenticationContext)
Method Detail

getHiddenFieldId

public java.lang.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 java.lang.String getColumnViewHtml(FieldLayoutItem fieldLayoutItem,
                                          java.util.Map displayParams,
                                          Issue issue)

calculateProgressPercentage

public static java.lang.Long calculateProgressPercentage(java.lang.Long spent,
                                                         java.lang.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

getTimeTrackingGraphBeanParameters

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

getDisplayId

protected abstract java.lang.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-2010 Atlassian. All Rights Reserved.