Class MockFieldLayout

java.lang.Object
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 Details

    • MockFieldLayout

      public MockFieldLayout()
  • Method Details

    • 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(ApplicationUser 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(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:
      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).
    • 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).
    • 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 ("jira-text-renderer")
    • 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