com.atlassian.greenhopper.web.field
Class BacklogField

java.lang.Object
  extended by com.pyxis.greenhopper.jira.fields.AbstractIssueField
      extended by com.pyxis.greenhopper.jira.fields.AbstractSelectField
          extended by com.atlassian.greenhopper.web.field.BacklogField
All Implemented Interfaces:
IssueField

public class BacklogField
extends AbstractSelectField

This whole thing is quite a mess. It's a renderer / view model instance that can fetch data (depending on the current user) and present formatted / translated values. At the same time, it provides facilities to update values, so it's also a kind of service. It has dependencies, but no real DI going on, as instances are getting created by IssueFieldManagerImpl. This should be split up, the model part belongs to the regular view model structure and the update part to a service layer. JIRA's field implementations are not something to be followed, but a first refactoring step done quite a while ago to group similar functionality.

Author:
ahennecke

Field Summary
 
Fields inherited from class com.pyxis.greenhopper.jira.fields.AbstractIssueField
GREENHOPPER_PLUGIN, GROUP_PICKER, id, idLong, label, MULTI_GROUP_PICKER, MULTI_SELECT, MULTI_USER_PICKER, NUMBER, SELECT, TEXT, TEXT_AREA, TEXT_FIELD, USER_PICKER
 
Constructor Summary
BacklogField(com.atlassian.jira.issue.fields.CustomField field, BacklogCustomFieldService backlogCustomFieldService, BacklogService backlogService, XProjectService xProjectService, WebUtilities webUtilities, BacklogRenderer backlogRenderer)
           
 
Method Summary
 boolean canEdit(BoardIssue boardIssue)
           
 java.util.LinkedList<FieldOption> getAllAvailableValuesForSelect(BoardIssue boardIssue)
          Build a hierarchically sorted list of FieldOptions for populating the select box
 java.lang.String getDefaultDisplayValue(BoardIssue boardIssue)
          used in select-create.vm
 java.lang.Object getDefaultValue(BoardIssue boardIssue)
           
 java.lang.String getDisplayValue(BoardIssue boardIssue)
           
 java.lang.String getLink(BoardIssue boardIssue, java.lang.String value)
           
 java.lang.String getTooltipValue(BoardIssue boardIssue)
           
 java.lang.Object getValue(BoardIssue boardIssue)
           
 java.lang.Object getValueFromString(java.lang.String values)
          Load the backlog for the given ID.
 boolean isClickable(BoardIssue boardIssue)
           
 boolean isCustomField()
           
 void updateValue(BoardIssue boardIssue, java.lang.String newValue)
           
 
Methods inherited from class com.pyxis.greenhopper.jira.fields.AbstractSelectField
doValidate, getCreateTemplate, getDisplayTemplate, getEditTemplate, getInputType, getUpdateTemplate, lines, weight
 
Methods inherited from class com.pyxis.greenhopper.jira.fields.AbstractIssueField
equals, getCssType, getId, getIdAsLong, getJsonDisplayTemplate, getLabel, getTransitionTemplate, hashCode, isCorner, validate
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BacklogField

public BacklogField(com.atlassian.jira.issue.fields.CustomField field,
                    BacklogCustomFieldService backlogCustomFieldService,
                    BacklogService backlogService,
                    XProjectService xProjectService,
                    WebUtilities webUtilities,
                    BacklogRenderer backlogRenderer)
Method Detail

getDisplayValue

public java.lang.String getDisplayValue(BoardIssue boardIssue)

getAllAvailableValuesForSelect

public java.util.LinkedList<FieldOption> getAllAvailableValuesForSelect(BoardIssue boardIssue)
Build a hierarchically sorted list of FieldOptions for populating the select box

Specified by:
getAllAvailableValuesForSelect in class AbstractSelectField

getValue

public java.lang.Object getValue(BoardIssue boardIssue)

getValueFromString

public java.lang.Object getValueFromString(java.lang.String values)
Load the backlog for the given ID. Expects values (sic) to be a single long ID of the backlog we care about.

Specified by:
getValueFromString in interface IssueField
Overrides:
getValueFromString in class AbstractSelectField

getDefaultDisplayValue

public java.lang.String getDefaultDisplayValue(BoardIssue boardIssue)
used in select-create.vm


getDefaultValue

public java.lang.Object getDefaultValue(BoardIssue boardIssue)

getTooltipValue

public java.lang.String getTooltipValue(BoardIssue boardIssue)

updateValue

public void updateValue(BoardIssue boardIssue,
                        java.lang.String newValue)
                 throws GreenHopperException,
                        java.lang.Exception
Throws:
GreenHopperException
java.lang.Exception

canEdit

public boolean canEdit(BoardIssue boardIssue)

isCustomField

public boolean isCustomField()
Specified by:
isCustomField in interface IssueField
Overrides:
isCustomField in class AbstractIssueField

getLink

public java.lang.String getLink(BoardIssue boardIssue,
                                java.lang.String value)
Specified by:
getLink in interface IssueField
Overrides:
getLink in class AbstractIssueField

isClickable

public boolean isClickable(BoardIssue boardIssue)
Specified by:
isClickable in interface IssueField
Overrides:
isClickable in class AbstractIssueField


Copyright © 2007-2011 Atlassian. All Rights Reserved.