Class MenuConfiguration
- Since:
- 24.5
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionCollect ordered list of menu entries for menu population.getMenuEntries(Locale locale) Collect ordered list of menu entries for menu population.Collect the menu entries as a hierarchy for menu population, nested according to the route hierarchy.getMenuEntriesTree(Locale locale) Collect the menu entries as a hierarchy for menu population, nested according to the route hierarchy.Retrieves the page header of the currently shown view.getPageHeader(Component content) Retrieves the page header of the currently shown view.
-
Constructor Details
-
MenuConfiguration
public MenuConfiguration()
-
-
Method Details
-
getMenuEntries
Collect ordered list of menu entries for menu population. All client views are collected and any accessible server views.- Returns:
- ordered list of
MenuEntryinstances
-
getMenuEntries
Collect ordered list of menu entries for menu population. All client views are collected and any accessible server views.- Parameters:
locale- locale to use for ordering. null for default locale.- Returns:
- ordered list of
MenuEntryinstances
-
getMenuEntriesTree
Collect the menu entries as a hierarchy for menu population, nested according to the route hierarchy.The same views as
getMenuEntries()are returned, but as a tree: server views are nested according to@RouteParent(with URL-prefix walking as fallback), and client views according to their file-system route nesting. Only root entries are returned; the descendants are reachable viaMenuEntry.children().- Returns:
- ordered list of root
MenuEntryinstances with nested children
-
getMenuEntriesTree
Collect the menu entries as a hierarchy for menu population, nested according to the route hierarchy.- Parameters:
locale- locale to use for ordering. null for default locale.- Returns:
- ordered list of root
MenuEntryinstances with nested children - See Also:
-
getPageHeader
Retrieves the page header of the currently shown view. Can be used in Flow main layouts to render a page header.Attempts to retrieve header from the following sources:
- from
ViewConfig.titleof the client-side views; - from
HasDynamicTitle.getPageTitle()if present, then fromPageTitlevalue of the server-side route
For server-side routes it falls back to route's Java class name, if a non-null
contentis given. For client-side views it falls back to the React element's function name, if a page header couldn't be retrieved from theViewConfig.Use
getPageHeader()method, if a content object is not available.- Parameters:
content- as aComponentclass that represents a content in layout, can benull, if unavailable.- Returns:
- optional page header for layout
- from
-
getPageHeader
Retrieves the page header of the currently shown view. Can be used in Flow main layouts to render a page header.Attempts to retrieve header from the following sources:
- from
ViewConfig.titleof the client-side views; - from
HasDynamicTitle.getPageTitle()if present, then fromPageTitlevalue of the server-side route
For server-side routes it falls back to route's Java class name. For client-side views it falls back to the React element's function name, if a page header couldn't be retrieved from the
ViewConfig.Note that the possible sources of page header are limited to only available views in automatic menu configuration. If a route has a mandatory route parameters or has a route template, then it won't be used as a possible header source, even if it's shown.
Use
getPageHeader(Component)if content object is available, e.g. inRouterLayoutbased layouts.- Returns:
- optional page header for layout
- from
-