public class DefaultNavComponentBuilder extends NavComponentBuilder<DefaultNavComponentBuilder>
Menu
instance.
Supports several attributes for influencing how a menu gets translated, see
NavComponentBuilder.ATTR_ICON
, NavComponentBuilder.ATTR_ITEM_VIEW_ELEMENT
, NavComponentBuilder.ATTR_LINK_VIEW_ELEMENT
.NavComponentBuilder.Separator
ATTR_ICON, ATTR_ICON_ONLY, ATTR_INSERT_SEPARATOR, ATTR_ITEM_VIEW_ELEMENT, ATTR_KEEP_AS_GROUP, ATTR_KEEP_GROUP_ITEM, ATTR_LINK_VIEW_ELEMENT, CTX_CURRENT_MENU_ITEM
Constructor and Description |
---|
DefaultNavComponentBuilder() |
Modifier and Type | Method and Description |
---|---|
protected com.foreach.across.modules.web.ui.elements.NodeViewElement |
buildMenu(com.foreach.across.modules.web.menu.Menu menuToRender,
com.foreach.across.modules.web.ui.ViewElementBuilderContext builderContext) |
DefaultNavComponentBuilder |
navbar()
Render menu as navbar links.
|
DefaultNavComponentBuilder |
pills()
Render menu as pills.
|
DefaultNavComponentBuilder |
replaceGroupBySelectedItem()
Shorthand for
replaceGroupBySelectedItem(true) . |
DefaultNavComponentBuilder |
replaceGroupBySelectedItem(boolean replaceGroup)
If
true , whenever a group has one of its items selected,
the link text for the group will be replaced by the text of the selected item. |
DefaultNavComponentBuilder |
simple()
Render menu with no specific nav style.
|
DefaultNavComponentBuilder |
stacked()
Render menu as stacked pills.
|
DefaultNavComponentBuilder |
tabs()
Render menu as tabs.
|
addHtmlAttributes, addIconAndText, addItemLink, addViewElementIfAttributeExists, createElement, filter, findFirstIncludedChild, findItemToRender, getFirstNonGroupSelectedItem, htmlAttribute, includedItems, keepGroupsAsGroup, menu, menu, numberOfChildrenToInclude, shouldIncludeItem, shouldKeepAsGroup
buildLink, linkBuilder
escapeHtml, isEscapeHtml, resolveTextElement, toTextElement
apply, attribute, attributes, clearAttributes, css, htmlId, removeAttribute, removeCss
add, add, addAll, addFirst, addFirst, sort
build, configure, customTemplate, name, postProcess, postProcessor, registerWebResources
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
public DefaultNavComponentBuilder simple()
public DefaultNavComponentBuilder tabs()
public DefaultNavComponentBuilder pills()
public DefaultNavComponentBuilder stacked()
public DefaultNavComponentBuilder navbar()
public DefaultNavComponentBuilder replaceGroupBySelectedItem()
replaceGroupBySelectedItem(true)
.public DefaultNavComponentBuilder replaceGroupBySelectedItem(boolean replaceGroup)
true
, whenever a group has one of its items selected,
the link text for the group will be replaced by the text of the selected item.
Only the url and optional NavComponentBuilder.ATTR_ICON
attribute of the selected item will be returned.
Default behaviour is not to do this but it can be user friendly in a tab navigation.replaceGroup
- true to replace the group labelprotected com.foreach.across.modules.web.ui.elements.NodeViewElement buildMenu(com.foreach.across.modules.web.menu.Menu menuToRender, com.foreach.across.modules.web.ui.ViewElementBuilderContext builderContext)
buildMenu
in class NavComponentBuilder<DefaultNavComponentBuilder>
Copyright © 2019. All rights reserved.