com.atlassian.jira.mock.issue.fields
Class MockNavigableField

java.lang.Object
  extended by com.atlassian.jira.mock.issue.fields.MockNavigableField
All Implemented Interfaces:
Field, NavigableField, Comparable

public class MockNavigableField
extends Object
implements NavigableField, Comparable

Since:
v4.0

Field Summary
 
Fields inherited from interface com.atlassian.jira.issue.fields.NavigableField
ORDER_ASCENDING, ORDER_DESCENDING, TEMPLATE_DIRECTORY_PATH
 
Constructor Summary
MockNavigableField(String id)
           
 
Method Summary
 int compareTo(Object o)
           
 boolean equals(Object o)
           
 String getColumnCssClass()
           
 String getColumnHeadingKey()
           
 String getColumnViewHtml(FieldLayoutItem fieldLayoutItem, Map displayParams, Issue issue)
           
 String getDefaultSortOrder()
          The order in which to sort the field when it is sorted for the first time.
 String getHiddenFieldId()
          Returns the id of the field to check for visibility.
 String getId()
          The unique id of the field
 String getName()
          Returns i18n'ed name of the field for system fields or the name of a custom field.
 String getNameKey()
          The i18n key that is used to lookup the field's name when it is displayed
 org.apache.lucene.search.FieldComparatorSource getSortComparatorSource()
          A sortComparatorSource object to be used for sorting columns in a table.
 LuceneFieldSorter getSorter()
          A sorter to be used when sorting columns in a table.
 int hashCode()
           
 String prettyPrintChangeHistory(String changeHistory)
           
 String prettyPrintChangeHistory(String changeHistory, I18nHelper i18nHelper)
          Used for email notification templates - allows changelog to be displayed in language of the recipient.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MockNavigableField

public MockNavigableField(String id)
Method Detail

getId

public String getId()
Description copied from interface: Field
The unique id of the field

Specified by:
getId in interface Field

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()
Description copied from interface: NavigableField
A sortComparatorSource object to be used for sorting columns in a table. In most cases this will use a MappedSortComparator using the NavigableField.getSorter() method. However, fields can provide any sorting mechanism that they wish.

Specified by:
getSortComparatorSource in interface NavigableField
Returns:
A SortComparatorSource that can be used to sort, or null if this field does not support sorting

getSorter

public LuceneFieldSorter getSorter()
Description copied from interface: NavigableField
A sorter to be used when sorting columns in a table. This sort uses the Lucene Document Collection and is therefore a lot faster than sorting the issues in memory.

Specified by:
getSorter in interface NavigableField
Returns:
A sorter that can be used to sort this field, or null depending on the value of NavigableField.getSortComparatorSource()
See Also:
DocumentIssueImpl, MappedSortComparator

getColumnViewHtml

public String getColumnViewHtml(FieldLayoutItem fieldLayoutItem,
                                Map displayParams,
                                Issue issue)
Specified by:
getColumnViewHtml in interface NavigableField

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

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

getNameKey

public String getNameKey()
Description copied from interface: Field
The i18n key that is used to lookup the field's name when it is displayed

Specified by:
getNameKey in interface Field

getName

public String getName()
Description copied from interface: Field
Returns i18n'ed name of the field for system fields or the name of a custom field.

Specified by:
getName in interface Field

equals

public boolean equals(Object o)
Overrides:
equals in class Object

hashCode

public int hashCode()
Overrides:
hashCode in class Object

compareTo

public int compareTo(Object o)
Specified by:
compareTo in interface Comparable


Copyright © 2002-2012 Atlassian. All Rights Reserved.