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.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
-
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
-