com.atlassian.jira.issue.fields
Class NavigableFieldImpl
java.lang.Object
com.atlassian.jira.issue.fields.AbstractField
com.atlassian.jira.issue.fields.NavigableFieldImpl
- All Implemented Interfaces:
- Field, NavigableField, Comparable
- Direct Known Subclasses:
- AbstractDurationSystemField, AbstractProgressBarSystemField, CreatedSystemField, KeySystemField, ResolutionDateSystemField, StatusSystemField, SubTaskSystemField, ThumbnailSystemField, UpdatedSystemField, VotesSystemField, WatchesSystemField, WorkRatioSystemField
public abstract class NavigableFieldImpl
- extends AbstractField
- implements NavigableField
Constructor Summary |
NavigableFieldImpl(String id,
String nameKey,
String columnHeadingKey,
String defaultSortOrder,
VelocityTemplatingEngine templatingEngine,
ApplicationProperties applicationProperties,
JiraAuthenticationContext authenticationContext)
|
NavigableFieldImpl(String id,
String nameKey,
String columnHeadingKey,
VelocityTemplatingEngine templatingEngine,
ApplicationProperties applicationProperties,
JiraAuthenticationContext authenticationContext)
|
templatingEngine
protected final VelocityTemplatingEngine templatingEngine
applicationProperties
protected final ApplicationProperties applicationProperties
NavigableFieldImpl
public NavigableFieldImpl(String id,
String nameKey,
String columnHeadingKey,
VelocityTemplatingEngine templatingEngine,
ApplicationProperties applicationProperties,
JiraAuthenticationContext authenticationContext)
NavigableFieldImpl
public NavigableFieldImpl(String id,
String nameKey,
String columnHeadingKey,
String defaultSortOrder,
VelocityTemplatingEngine templatingEngine,
ApplicationProperties applicationProperties,
JiraAuthenticationContext authenticationContext)
getColumnHeadingKey
public String getColumnHeadingKey()
- Specified by:
getColumnHeadingKey
in interface NavigableField
getColumnCssClass
public String getColumnCssClass()
- Specified by:
getColumnCssClass
in interface NavigableField
getDefaultSortOrder
public String getDefaultSortOrder()
- Description copied from interface:
NavigableField
- The order in which to sort the field when it is sorted for the first time.
- Specified by:
getDefaultSortOrder
in interface NavigableField
- Returns:
- Either
NavigableField.ORDER_ASCENDING
or NavigableField.ORDER_DESCENDING
getSortComparatorSource
public org.apache.lucene.search.FieldComparatorSource getSortComparatorSource()
- A default implementation that returns a
MappedSortComparator
from NavigableField.getSorter()
.
- Specified by:
getSortComparatorSource
in interface NavigableField
- Returns:
- A SortComparatorSource that can be used to sort, or null if this field does not use custom sorting
getSortFields
public List<org.apache.lucene.search.SortField> getSortFields(boolean sortOrder)
- Description copied from interface:
NavigableField
- Return a list of Lucene SortFields to be used for sorting search results.
Using this method allows the field to specify the most performant way to perform a search. If a field can be
sorted directly using the term in the index then this should just return a singleton list with the sort field.
return Collections.singletonList(new SortField(fieldName, sortOrder));
The default implementation builds this using the FieldComparatorSource returned by NavigableField.getSortComparatorSource()
If you implement this method there is no need to implement NavigableField.getSortComparatorSource()
.
- Specified by:
getSortFields
in interface NavigableField
- Returns:
- The name of the indexed term to be used for native Lucene sorting.
renderTemplate
protected String renderTemplate(String template,
Map velocityParams)
getVelocityParams
protected Map<String,Object> getVelocityParams(FieldLayoutItem fieldLayoutItem,
I18nHelper i18nHelper,
Map displayParams,
Issue issue)
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
getApplicationProperties
protected ApplicationProperties getApplicationProperties()
prettyPrintChangeHistory
public String prettyPrintChangeHistory(String changeHistory)
- Specified by:
prettyPrintChangeHistory
in interface NavigableField
prettyPrintChangeHistory
public String prettyPrintChangeHistory(String changeHistory,
I18nHelper i18nHelper)
- Description copied from interface:
NavigableField
- Used for email notification templates - allows changelog to be displayed in language of the recipient.
- Specified by:
prettyPrintChangeHistory
in interface NavigableField
- Returns:
- String change history formatted according to locale in i18nHelper
Copyright © 2002-2012 Atlassian. All Rights Reserved.