com.atlassian.jira.issue.fields
Class AbstractOrderableField

java.lang.Object
  extended by com.atlassian.jira.issue.fields.AbstractField
      extended by com.atlassian.jira.issue.fields.AbstractOrderableField
All Implemented Interfaces:
Field, OrderableField, SearchableField, Comparable
Direct Known Subclasses:
AbstractOrderableNavigableFieldImpl, AttachmentSystemField, CommentSystemField, TimeTrackingSystemField

public abstract class AbstractOrderableField
extends AbstractField
implements OrderableField

Copyright (c) 2002-2004 All rights reserved.


Field Summary
 
Fields inherited from class com.atlassian.jira.issue.fields.AbstractField
authenticationContext
 
Fields inherited from interface com.atlassian.jira.issue.fields.OrderableField
MOVE_ISSUE_PARAM_KEY, NO_HEADER_PARAM_KEY, TEMPLATE_DIRECTORY_PATH
 
Constructor Summary
AbstractOrderableField(String id, String name, com.atlassian.velocity.VelocityManager velocityManager, ApplicationProperties applicationProperties, JiraAuthenticationContext authenticationContext, PermissionManager permissionManager)
           
 
Method Summary
protected  ApplicationProperties getApplicationProperties()
           
 String getBulkEditHtml(OperationContext operationContext, webwork.action.Action action, BulkEditBean bulkEditBean, Map displayParameters)
          Returns HTML that should be shown when the issue is being bulk edited.
 String getCreateHtml(FieldLayoutItem fieldLayoutItem, OperationContext operationContext, webwork.action.Action action, Issue issue)
          Returns the HTML that should be shown when the issue is being created.
 String getEditHtml(FieldLayoutItem fieldLayoutItem, OperationContext operationContext, webwork.action.Action action, Issue issue)
          Returns HTML that should be shown when the issue is being edited.
protected  PermissionManager getPermissionManager()
           
protected abstract  Object getRelevantParams(Map params)
           
protected  Map getVelocityParams(FieldLayoutItem fieldLayoutItem, webwork.action.Action action, Issue issue, Map displayParameters)
           
protected  Map getVelocityParams(Issue issue)
           
 String getViewHtml(FieldLayoutItem fieldLayoutItem, webwork.action.Action action, Issue issue)
           
protected  boolean hasBulkUpdatePermission(BulkEditBean bulkEditBean, Issue issue)
           
protected  boolean hasPermission(Issue issue, int permissionId)
           
protected  boolean isHidden(Collection fieldLayouts)
          Determines if the field is hidden in at least one field layout.
 void populateFromParams(Map fieldValuesHolder, Map parameters)
          Populate the fieldValuesHolder with a value from (web) parameters.
protected  boolean rendererTypesEqual(String oldRendererType, String newRendererType)
           
protected  String renderTemplate(String template, Map velocityParams)
           
protected  boolean valuesEqual(Object value, Object currentValue)
           
 
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.OrderableField
availableForBulkEdit, canRemoveValueFromIssueObject, createValue, getCreateHtml, getDefaultValue, getEditHtml, getValueFromParams, getViewHtml, getViewHtml, hasValue, isShown, needsMove, populateDefaults, populateForMove, populateFromIssue, populateParamsFromString, removeValueFromIssueObject, updateIssue, updateValue, validateParams
 
Methods inherited from interface com.atlassian.jira.issue.fields.SearchableField
getAssociatedSearchers
 
Methods inherited from interface com.atlassian.jira.issue.fields.Field
getId, getName, getNameKey
 
Methods inherited from interface java.lang.Comparable
compareTo
 

Constructor Detail

AbstractOrderableField

public AbstractOrderableField(String id,
                              String name,
                              com.atlassian.velocity.VelocityManager velocityManager,
                              ApplicationProperties applicationProperties,
                              JiraAuthenticationContext authenticationContext,
                              PermissionManager permissionManager)
Method Detail

getCreateHtml

public String getCreateHtml(FieldLayoutItem fieldLayoutItem,
                            OperationContext operationContext,
                            webwork.action.Action action,
                            Issue issue)
Description copied from interface: OrderableField
Returns the HTML that should be shown when the issue is being created.

Specified by:
getCreateHtml in interface OrderableField
Parameters:
fieldLayoutItem - FieldLayoutItem
operationContext - OperationContext
action - Action
issue - Issue
Returns:
the HTML that should be shown when the issue is being created.

getEditHtml

public String getEditHtml(FieldLayoutItem fieldLayoutItem,
                          OperationContext operationContext,
                          webwork.action.Action action,
                          Issue issue)
Description copied from interface: OrderableField
Returns HTML that should be shown when the issue is being edited.

Specified by:
getEditHtml in interface OrderableField
Parameters:
fieldLayoutItem - FieldLayoutItem
operationContext - OperationContext
action - Action
issue - Issue
Returns:
HTML that should be shown when the issue is being edited.

getBulkEditHtml

public String getBulkEditHtml(OperationContext operationContext,
                              webwork.action.Action action,
                              BulkEditBean bulkEditBean,
                              Map displayParameters)
Returns HTML that should be shown when the issue is being bulk edited. By default calls the OrderableField.getEditHtml(com.atlassian.jira.issue.fields.layout.field.FieldLayoutItem, com.atlassian.jira.issue.customfields.OperationContext, webwork.action.Action, com.atlassian.jira.issue.Issue, java.util.Map) method with null for FieldLayoutItem and the first issue in the collection}

Specified by:
getBulkEditHtml in interface OrderableField
Parameters:
operationContext - OperationContext
action - Action
bulkEditBean - BulkEditBean
displayParameters - Map of display parameters.
Returns:
HTML that should be shown when the issue is being edited.

getViewHtml

public String getViewHtml(FieldLayoutItem fieldLayoutItem,
                          webwork.action.Action action,
                          Issue issue)
Specified by:
getViewHtml in interface OrderableField

populateFromParams

public void populateFromParams(Map fieldValuesHolder,
                               Map parameters)
Description copied from interface: OrderableField
Populate the fieldValuesHolder with a value from (web) parameters.

Specified by:
populateFromParams in interface OrderableField
Parameters:
fieldValuesHolder - The fieldValuesHolder Map to be populated.
parameters - Map of parameters.

renderTemplate

protected String renderTemplate(String template,
                                Map velocityParams)

getApplicationProperties

protected ApplicationProperties getApplicationProperties()

getRelevantParams

protected abstract Object getRelevantParams(Map params)

getVelocityParams

protected Map getVelocityParams(FieldLayoutItem fieldLayoutItem,
                                webwork.action.Action action,
                                Issue issue,
                                Map displayParameters)

getVelocityParams

protected Map getVelocityParams(Issue issue)

valuesEqual

protected boolean valuesEqual(Object value,
                              Object currentValue)

isHidden

protected boolean isHidden(Collection fieldLayouts)
Determines if the field is hidden in at least one field layout.

Parameters:
fieldLayouts - the field layouts to check
Returns:
true if the field is hidden in at least one of the passed field layouts, false otherwise

rendererTypesEqual

protected boolean rendererTypesEqual(String oldRendererType,
                                     String newRendererType)

hasPermission

protected boolean hasPermission(Issue issue,
                                int permissionId)

hasBulkUpdatePermission

protected boolean hasBulkUpdatePermission(BulkEditBean bulkEditBean,
                                          Issue issue)

getPermissionManager

protected PermissionManager getPermissionManager()


Copyright © 2002-2009 Atlassian. All Rights Reserved.