Package com.atlassian.jira.issue.util
Class IssueOperationsBarUtil
java.lang.Object
com.atlassian.jira.issue.util.IssueOperationsBarUtil
Utility class to help with the creation of the View Issues Ops Bar.
Does a lot of caching (only request scope) as we need constantly need to check the sizes of different lists and it is hard to keep track of a lot of these things in the view layer.
Could possibly refactor this in the future to make it more generic to make any Ops bar for any page. E.g Issue Nav
- Since:
- v4.1
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionIssueOperationsBarUtil(JiraHelper helper, ApplicationUser user, SimpleLinkManager simpleLinkManager, ApplicationProperties applicationProperties, IssueManager issueManager, PermissionManager permissionManager, I18nHelper i18n) -
Method Summary
Modifier and TypeMethodDescriptionGets all the groups for the Ops bar - Operations, Transitions, ...getLabelForLink(SimpleLink link) Get a display label for a link Shows a maximum of 25 characters.Get a list of sections that contain links that have not be promoted.getNonPromotedLinksForSection(SimpleLinkSection group, SimpleLinkSection section) Get all the links for a section that were not promoted.getPrimaryOperationLinks(Issue issue) Gets all the links that have been promoted out of the sub-sections, into the top level.getTitleForLink(SimpleLink link) Get the title for the link.booleanhasLinks(SimpleLinkSection group) Tells the caller if the passed group has any links (promoted or otherwise) to display.booleanWhether we need to display the more link for a group.
-
Field Details
-
EDIT_LINK_ID
- See Also:
-
COMMENT_LINK_ID
- See Also:
-
-
Constructor Details
-
IssueOperationsBarUtil
public IssueOperationsBarUtil(JiraHelper helper, ApplicationUser user, SimpleLinkManager simpleLinkManager, ApplicationProperties applicationProperties, IssueManager issueManager, PermissionManager permissionManager, I18nHelper i18n)
-
-
Method Details
-
getGroups
Gets all the groups for the Ops bar - Operations, Transitions, ...- Returns:
- A list of sections that contain other sections.
-
hasLinks
Tells the caller if the passed group has any links (promoted or otherwise) to display.- Parameters:
group- the group to check.- Returns:
- true if the passed group has links to display.
-
getPromotedLinks
Gets all the links that have been promoted out of the sub-sections, into the top level.The number of links promoted is determined by the jira-application.properties property: ops.bar.group.size = 2
Though this can be overridden for individual groups: ops.bar.group.size.opsbar-operations = 3
- Parameters:
group- The group for which these links belong. E.g. opbsbar-operations- Returns:
- A list of links that contain all promoted links
-
getNonPromotedLinksForSection
public List<SimpleLink> getNonPromotedLinksForSection(SimpleLinkSection group, SimpleLinkSection section) Get all the links for a section that were not promoted.- Parameters:
group- The group which section belongs to.section- The section to get the links for.- Returns:
- a list of links for the section minus the promoted links
-
getNonEmptySectionsForGroup
Get a list of sections that contain links that have not be promoted.- Parameters:
group- The group to get the sections for.- Returns:
- a list of sections that contain 1 or more links that have not been promoted.
-
showMoreLinkforGroup
Whether we need to display the more link for a group. We display the more link if the group has a a label or if there are more items to show in a drop down.- Parameters:
group- The group to get the label for.- Returns:
- true if twe should display a more link, otherwise false.
-
getLabelForLink
Get a display label for a link Shows a maximum of 25 characters.- Parameters:
link- the link to get the label for.- Returns:
- the links label, abbreviated to 25 chars
-
getTitleForLink
Get the title for the link. If the link label has been abbreviated and there is no set title, use the full label.- Parameters:
link- The link to get the title for.- Returns:
- The title for the link
-
getPrimaryOperationLinks
-