com.atlassian.jira.issue.fields.layout.field
Class MockFieldLayout

java.lang.Object
  extended by com.atlassian.jira.issue.fields.layout.field.MockFieldLayout
All Implemented Interfaces:
FieldLayout

public class MockFieldLayout
extends Object
implements FieldLayout

Simple mock implementation of FieldLayout.

Since:
v4.1

Constructor Summary
MockFieldLayout()
           
 
Method Summary
 MockFieldLayoutItem addFieldLayoutItem(OrderableField orderableField)
           
 String getDescription()
          The description of the field configuration.
 FieldLayoutItem getFieldLayoutItem(OrderableField orderableField)
          Returns the field layout item for a given orderable field, if this orderable field is part of this field configuration.
 FieldLayoutItem getFieldLayoutItem(String fieldId)
          Returns the field layout item for a given field if, if this field is part of this field configuration.
 List<FieldLayoutItem> getFieldLayoutItems()
          A list of field layout item of this field configuration.
 org.ofbiz.core.entity.GenericValue getGenericValue()
          The generic value which represents this field configuration.
 List<Field> getHiddenFields(Project project, List<String> issueTypeIds)
          Returns all hidden fields (system fields and custom fields) for a given project and issue type(s).
 List<Field> getHiddenFields(com.atlassian.crowd.embedded.api.User remoteUser, org.ofbiz.core.entity.GenericValue project, List<String> issueTypeIds)
           
 List<Field> getHiddenFields(com.atlassian.crowd.embedded.api.User remoteUser, Project project, List<String> issueTypeIds)
           
 Long getId()
          The id of the field configuration.
 String getName()
          The name of the field configuration
 String getRendererTypeForField(String fieldId)
          Returns the render type for a given field in this field configuration.
 List<FieldLayoutItem> getRequiredFieldLayoutItems(Project project, List<String> issueTypes)
          Returns the list of required fields for an issue type in a project.
 List<FieldLayoutItem> getVisibleCustomFieldLayoutItems(Project project, List<String> issueTypes)
          Returns the list of Custom Fields in this Field Layout that are both visible and applicable to the given context (of project and Issue types).
 List<FieldLayoutItem> getVisibleLayoutItems(com.atlassian.crowd.embedded.api.User remoteUser, org.ofbiz.core.entity.GenericValue project, List<String> issueTypes)
           
 List<FieldLayoutItem> getVisibleLayoutItems(com.atlassian.crowd.embedded.api.User remoteUser, Project project, List<String> issueTypes)
          Returns all visible field layout items (system fields and custom fields) for a given project and issue type(s).
 boolean isDefault()
          Returns true if this is the default FieldLayout.
 boolean isFieldHidden(String fieldId)
          Checks if a field is hidden in this field configuration.
 MockFieldLayout setDefault(boolean defaultLayout)
           
 MockFieldLayout setDescription(String description)
           
 MockFieldLayout setId(Long id)
           
 MockFieldLayout setName(String name)
           
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

MockFieldLayout

public MockFieldLayout()
Method Detail

getId

public Long getId()
Description copied from interface: FieldLayout
The id of the field configuration.

Specified by:
getId in interface FieldLayout
Returns:
the id

setId

public MockFieldLayout setId(Long id)

getName

public String getName()
Description copied from interface: FieldLayout
The name of the field configuration

Specified by:
getName in interface FieldLayout
Returns:
the name

setName

public MockFieldLayout setName(String name)

getDescription

public String getDescription()
Description copied from interface: FieldLayout
The description of the field configuration.

Specified by:
getDescription in interface FieldLayout
Returns:
the description

setDescription

public MockFieldLayout setDescription(String description)

getFieldLayoutItems

public List<FieldLayoutItem> getFieldLayoutItems()
Description copied from interface: FieldLayout
A list of field layout item of this field configuration.

Specified by:
getFieldLayoutItems in interface FieldLayout
Returns:
a list of field layout items of this field configuration.

getGenericValue

public org.ofbiz.core.entity.GenericValue getGenericValue()
Description copied from interface: FieldLayout
The generic value which represents this field configuration.

Specified by:
getGenericValue in interface FieldLayout
Returns:
the generic value

getFieldLayoutItem

public FieldLayoutItem getFieldLayoutItem(OrderableField orderableField)
Description copied from interface: FieldLayout
Returns the field layout item for a given orderable field, if this orderable field is part of this field configuration.

Specified by:
getFieldLayoutItem in interface FieldLayout
Parameters:
orderableField - the orderable field to find in this field configuration.
Returns:
the field layout item if this field is part of this field configuration, otherwise null.

getFieldLayoutItem

public FieldLayoutItem getFieldLayoutItem(String fieldId)
Description copied from interface: FieldLayout
Returns the field layout item for a given field if, if this field is part of this field configuration.

Specified by:
getFieldLayoutItem in interface FieldLayout
Parameters:
fieldId - the id of the field.
Returns:
the field layout item if this field is part of this field configuration, otherwise null.

addFieldLayoutItem

public MockFieldLayoutItem addFieldLayoutItem(OrderableField orderableField)

getVisibleLayoutItems

public List<FieldLayoutItem> getVisibleLayoutItems(com.atlassian.crowd.embedded.api.User remoteUser,
                                                   Project project,
                                                   List<String> issueTypes)
Description copied from interface: FieldLayout
Returns all visible field layout items (system fields and custom fields) for a given project and issue type(s).

Specified by:
getVisibleLayoutItems in interface FieldLayout
Parameters:
remoteUser - the user TODO: User is not used! We should remove it!
project - the project
issueTypes - a list of issue types to use when checking for VISIBLE CUSTOM FIELDS.
Returns:
all visible field layout items for the given project and it's issue type(s).

getVisibleLayoutItems

public List<FieldLayoutItem> getVisibleLayoutItems(com.atlassian.crowd.embedded.api.User remoteUser,
                                                   org.ofbiz.core.entity.GenericValue project,
                                                   List<String> issueTypes)

getVisibleCustomFieldLayoutItems

public List<FieldLayoutItem> getVisibleCustomFieldLayoutItems(Project project,
                                                              List<String> issueTypes)
Description copied from interface: FieldLayout
Returns the list of Custom Fields in this Field Layout that are both visible and applicable to the given context (of project and Issue types).

Specified by:
getVisibleCustomFieldLayoutItems in interface FieldLayout
Parameters:
project - The project context
issueTypes - The Issue Types for context
Returns:
the list of visible Custom Fields applicable to the given context (of project and Issue types).

getHiddenFields

public List<Field> getHiddenFields(Project project,
                                   List<String> issueTypeIds)
Description copied from interface: FieldLayout
Returns all hidden fields (system fields and custom fields) for a given project and issue type(s).

Specified by:
getHiddenFields in interface FieldLayout
Parameters:
project - the project
issueTypeIds - issueTypes a list of issue types to use when checking for HIDDEN CUSTOM FIELDS.
Returns:
all hidden fields (system fields and custom fields).

getHiddenFields

public List<Field> getHiddenFields(com.atlassian.crowd.embedded.api.User remoteUser,
                                   org.ofbiz.core.entity.GenericValue project,
                                   List<String> issueTypeIds)
Specified by:
getHiddenFields in interface FieldLayout

getHiddenFields

public List<Field> getHiddenFields(com.atlassian.crowd.embedded.api.User remoteUser,
                                   Project project,
                                   List<String> issueTypeIds)
Specified by:
getHiddenFields in interface FieldLayout

getRequiredFieldLayoutItems

public List<FieldLayoutItem> getRequiredFieldLayoutItems(Project project,
                                                         List<String> issueTypes)
Description copied from interface: FieldLayout
Returns the list of required fields for an issue type in a project.

Specified by:
getRequiredFieldLayoutItems in interface FieldLayout
Parameters:
project - the project
issueTypes - the issue type.
Returns:
the list of required fields. System fields and custom fields.

isFieldHidden

public boolean isFieldHidden(String fieldId)
Description copied from interface: FieldLayout
Checks if a field is hidden in this field configuration.

Specified by:
isFieldHidden in interface FieldLayout
Parameters:
fieldId - the field id.
Returns:
true if the field is hidden, otherwise false.

getRendererTypeForField

public String getRendererTypeForField(String fieldId)
Description copied from interface: FieldLayout
Returns the render type for a given field in this field configuration.

Specified by:
getRendererTypeForField in interface FieldLayout
Parameters:
fieldId - the id of the field.
Returns:
the type of the renderer e.g. DefaultTextRenderer.RENDERER_TYPE

isDefault

public boolean isDefault()
Description copied from interface: FieldLayout
Returns true if this is the default FieldLayout. This means that the "type" field holds "value".

Specified by:
isDefault in interface FieldLayout
Returns:
true if this is the default FieldLayout.

setDefault

public MockFieldLayout setDefault(boolean defaultLayout)

toString

public String toString()
Overrides:
toString in class Object


Copyright © 2002-2012 Atlassian. All Rights Reserved.