Class NavSideMenu
- java.lang.Object
-
- org.devacfr.maven.skins.reflow.model.Component
-
- org.devacfr.maven.skins.reflow.model.BsComponent
-
- org.devacfr.maven.skins.reflow.model.NavSideMenu
-
public class NavSideMenu extends BsComponent
Represents the navside menu component used in document page.A sample configuration would be like that:
<custom> <reflowSkin> <pages> <document type="doc"> <menu name="Documentation" selectFirstOnExpand="true"> <item name="Get Started" href="get-started.html" /> <item name="Layouts"> <item name="Overview" href="layouts.html" /> <item name="Body" href="body.html" /> </item> <item name="Migration" href="migration.html" /> </menu> </document> </pages> </reflowSkin> </custom>∂- Since:
- 2.0
- Author:
- Christophe Friederich
-
-
Constructor Summary
Constructors Constructor Description NavSideMenu(ISkinConfig config)Default constructor.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static List<SideNavMenuItem>findAllSideNavMenuItems(ISkinConfig config)Find allsidenav menu itemsdeclared in all document pages.List<SideNavMenuItem>getItems()StringgetName()Gets the name of menu displayed on top of navside menu.booleanisHasItems()Gets the indicating whether menu contains a least one menu item.booleanisSelectFirstOnExpand()Gets the indicating whether the first sub menu item should be selected when a dropdown menu item is selected and should expand.StringtoString()protected NavSideMenuwithItems(List<SideNavMenuItem> items)Sets theListofSideNavMenuItem.protected NavSideMenuwithName(String name)Sets the name of menu displayed on top of navside menu.protected NavSideMenuwithSelectFirstOnSelect(boolean selectFirstOnExpand)Sets the indicating whether the first sub menu item should be selected when a dropdown menu item is selected and should expand.-
Methods inherited from class org.devacfr.maven.skins.reflow.model.BsComponent
getBackground, getCssClass, getTheme, setBackground, setTheme
-
Methods inherited from class org.devacfr.maven.skins.reflow.model.Component
addChildren, addCssOptions, getCssOptions, onPreRender, setCssClass
-
-
-
-
Constructor Detail
-
NavSideMenu
public NavSideMenu(@Nonnull ISkinConfig config)
Default constructor.- Parameters:
config- a config (can not benull).
-
-
Method Detail
-
findAllSideNavMenuItems
@Nonnull public static List<SideNavMenuItem> findAllSideNavMenuItems(@Nonnull ISkinConfig config)
Find allsidenav menu itemsdeclared in all document pages.- Parameters:
config- a config (can not benull).- Returns:
- Returns a list of all all
sidenav menu itemsdeclared in all document pages (returns list can not benull).
-
getName
@Nullable public String getName()
Gets the name of menu displayed on top of navside menu.- Returns:
- Returns a
Stringrepresenting the name of menu.
-
withName
protected NavSideMenu withName(String name)
Sets the name of menu displayed on top of navside menu.- Parameters:
name- the name to use.- Returns:
- Returns the fluent instance.
-
isHasItems
public boolean isHasItems()
Gets the indicating whether menu contains a least one menu item.- Returns:
- Returns
truewhether menu contains a least one menu item, otherwise returnsfalse.
-
getItems
@Nonnull public List<SideNavMenuItem> getItems()
- Returns:
- Returns the
ListofSideNavMenuItemcontaining in<menu> element.
-
withItems
protected NavSideMenu withItems(List<SideNavMenuItem> items)
Sets theListofSideNavMenuItem.- Parameters:
items- list of items to use.- Returns:
- Returns the fluent instance.
-
isSelectFirstOnExpand
public boolean isSelectFirstOnExpand()
Gets the indicating whether the first sub menu item should be selected when a dropdown menu item is selected and should expand.- Returns:
- Returns
truewhether the first sub menu item should be selected when a dropdown menu item is selected and expanded, otherwise returnsfalse.
-
withSelectFirstOnSelect
protected NavSideMenu withSelectFirstOnSelect(boolean selectFirstOnExpand)
Sets the indicating whether the first sub menu item should be selected when a dropdown menu item is selected and should expand.- Parameters:
selectFirstOnExpand- a value to use.- Returns:
- Returns the fluent instance.
-
-