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, java.lang.Comparable
Direct Known Subclasses:
AbstractOrderableNavigableFieldImpl, AttachmentSystemField, CommentSystemField, TimeTrackingSystemField, WorklogSystemField

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(java.lang.String id, java.lang.String name, com.atlassian.velocity.VelocityManager velocityManager, ApplicationProperties applicationProperties, JiraAuthenticationContext authenticationContext, PermissionManager permissionManager, SearchHandlerFactory searcherHandlerFactory)
           
 
Method Summary
 SearchHandler createAssociatedSearchHandler()
          Return SearchHandler for the field.
protected  ApplicationProperties getApplicationProperties()
           
 java.lang.String getBulkEditHtml(OperationContext operationContext, webwork.action.Action action, BulkEditBean bulkEditBean, java.util.Map displayParameters)
          Returns HTML that should be shown when the issue is being bulk edited.
 java.lang.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.
 java.lang.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  java.lang.Object getRelevantParams(java.util.Map params)
           
protected  java.util.Map<java.lang.String,java.lang.Object> getVelocityParams(FieldLayoutItem fieldLayoutItem, webwork.action.Action action, Issue issue, java.util.Map displayParams)
           
protected  java.util.Map<java.lang.String,java.lang.Object> getVelocityParams(Issue issue)
           
 java.lang.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(java.util.Collection fieldLayouts)
          Determines if the field is hidden in at least one field layout.
 void populateFromParams(java.util.Map fieldValuesHolder, java.util.Map parameters)
          Populate the fieldValuesHolder with a value from (web) parameters.
protected  boolean rendererTypesEqual(java.lang.String oldRendererType, java.lang.String newRendererType)
           
protected  java.lang.String renderTemplate(java.lang.String template, java.util.Map velocityParams)
           
protected  boolean valuesEqual(java.lang.Object value, java.lang.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.Field
getId, getName, getNameKey
 
Methods inherited from interface java.lang.Comparable
compareTo
 

Constructor Detail

AbstractOrderableField

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

getCreateHtml

public java.lang.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 java.lang.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.

createAssociatedSearchHandler

public SearchHandler createAssociatedSearchHandler()
Description copied from interface: SearchableField
Return SearchHandler for the field. This object tells JIRA how to search for values within the field.

Specified by:
createAssociatedSearchHandler in interface SearchableField
Returns:
the SearchHandler associated with the field. Can return null when no searcher is associated with the field. This will mainly happen when a customfield is configured to have no searcher.

getBulkEditHtml

public java.lang.String getBulkEditHtml(OperationContext operationContext,
                                        webwork.action.Action action,
                                        BulkEditBean bulkEditBean,
                                        java.util.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 java.lang.String getViewHtml(FieldLayoutItem fieldLayoutItem,
                                    webwork.action.Action action,
                                    Issue issue)
Specified by:
getViewHtml in interface OrderableField

populateFromParams

public void populateFromParams(java.util.Map fieldValuesHolder,
                               java.util.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 java.lang.String renderTemplate(java.lang.String template,
                                          java.util.Map velocityParams)

getApplicationProperties

protected ApplicationProperties getApplicationProperties()

getRelevantParams

protected abstract java.lang.Object getRelevantParams(java.util.Map params)

getVelocityParams

protected java.util.Map<java.lang.String,java.lang.Object> getVelocityParams(FieldLayoutItem fieldLayoutItem,
                                                                             webwork.action.Action action,
                                                                             Issue issue,
                                                                             java.util.Map displayParams)

getVelocityParams

protected java.util.Map<java.lang.String,java.lang.Object> getVelocityParams(Issue issue)

valuesEqual

protected boolean valuesEqual(java.lang.Object value,
                              java.lang.Object currentValue)

isHidden

protected boolean isHidden(java.util.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(java.lang.String oldRendererType,
                                     java.lang.String newRendererType)

hasPermission

protected boolean hasPermission(Issue issue,
                                int permissionId)

hasBulkUpdatePermission

protected boolean hasBulkUpdatePermission(BulkEditBean bulkEditBean,
                                          Issue issue)

getPermissionManager

protected PermissionManager getPermissionManager()


Copyright © 2002-2010 Atlassian. All Rights Reserved.