Package com.atlassian.confluence.web
Class ConfluenceWebMenuManager
- java.lang.Object
-
- com.atlassian.confluence.web.ConfluenceWebMenuManager
-
- All Implemented Interfaces:
WebMenuManager
public class ConfluenceWebMenuManager extends Object implements WebMenuManager
Retrieves menu details from plugins via aConfluenceWebInterfaceManager
.
-
-
Field Summary
Fields Modifier and Type Field Description protected ConfluenceWebInterfaceManager
webInterfaceManager
-
Constructor Summary
Constructors Constructor Description ConfluenceWebMenuManager()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected List<com.atlassian.plugin.web.descriptors.WebItemModuleDescriptor>
getLeadingItems(String menuKey, WebInterfaceContext context)
Returns items to be displayed at the top of the menu.WebMenu
getMenu(String id, String menuKey, WebInterfaceContext context)
Builds and returns aWebMenu
for display with the given properties and context.WebMenu
getMenu(String id, Collection<String> menuKeys, WebInterfaceContext context)
Builds and returns aWebMenu
for display with the given properties and context.protected List<com.atlassian.plugin.web.descriptors.WebItemModuleDescriptor>
getSectionItems(String menuKey, String sectionKey, WebInterfaceContext context)
Returns the items for a given section in the menu.protected List<com.atlassian.plugin.web.descriptors.WebSectionModuleDescriptor>
getSections(String menuKey, WebInterfaceContext context)
Returns sections to be displayed in the menu.protected List<com.atlassian.plugin.web.descriptors.WebItemModuleDescriptor>
getTrailingItems(String menuKey, WebInterfaceContext context)
Returns items to be displayed at the bottom of the menu.void
setWebInterfaceManager(ConfluenceWebInterfaceManager webInterfaceManager)
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface com.atlassian.confluence.web.WebMenuManager
getMenu
-
-
-
-
Field Detail
-
webInterfaceManager
protected ConfluenceWebInterfaceManager webInterfaceManager
-
-
Method Detail
-
getMenu
public WebMenu getMenu(String id, String menuKey, WebInterfaceContext context)
Description copied from interface:WebMenuManager
Builds and returns aWebMenu
for display with the given properties and context.WebMenuSection
)s with no menu items are not included in the final menu returned.- Specified by:
getMenu
in interfaceWebMenuManager
- Parameters:
id
- the id of the menumenuKey
- the web section key of the menu being built (seeWebInterfaceManager
)context
- the context in which the menu is being built in- Returns:
WebMenu
which can be used for display
-
getMenu
public WebMenu getMenu(String id, Collection<String> menuKeys, WebInterfaceContext context)
Description copied from interface:WebMenuManager
Builds and returns aWebMenu
for display with the given properties and context. This method takes in a list of menu keys to allow for building a combination of menus.WebMenuSection
)s with no menu items are not included in the final menu returned.- Specified by:
getMenu
in interfaceWebMenuManager
- Parameters:
id
- the id of the menumenuKeys
- the web section keys of the menu being built with (seeWebInterfaceManager
)context
- the context in which the menu is being built in- Returns:
WebMenu
which can be used for display
-
getSectionItems
protected List<com.atlassian.plugin.web.descriptors.WebItemModuleDescriptor> getSectionItems(String menuKey, String sectionKey, WebInterfaceContext context)
Returns the items for a given section in the menu. This implementation returns all web-item plugin modules within the given menu and section that are visible according to the context.- Returns:
- the items to display in the given section, or an empty list if there are none
-
getSections
protected List<com.atlassian.plugin.web.descriptors.WebSectionModuleDescriptor> getSections(String menuKey, WebInterfaceContext context)
Returns sections to be displayed in the menu. This implementation returns all web-section plugin modules found in the menu that are visible according to the context.- Returns:
- the sections making up the main content of the menu, or an empty list if there are no sections
-
getTrailingItems
protected List<com.atlassian.plugin.web.descriptors.WebItemModuleDescriptor> getTrailingItems(String menuKey, WebInterfaceContext context)
Returns items to be displayed at the bottom of the menu. This implementation returns an empty list.- Returns:
- a list of items that should go at the bottom of the menu, or empty list if no trailing items
-
getLeadingItems
protected List<com.atlassian.plugin.web.descriptors.WebItemModuleDescriptor> getLeadingItems(String menuKey, WebInterfaceContext context)
Returns items to be displayed at the top of the menu. This implementation returns web-item plugin modules found in the menu but not in a section that are visible according to the context.- Returns:
- a list of items that should go at the top of the menu, or empty list if there are no leading items
-
setWebInterfaceManager
public void setWebInterfaceManager(ConfluenceWebInterfaceManager webInterfaceManager)
-
-