Class DefaultNavComponentBuilder
java.lang.Object
com.foreach.across.modules.web.ui.ViewElementBuilderSupport<T,SELF>
com.foreach.across.modules.web.ui.elements.builder.ContainerViewElementBuilderSupport<T,SELF>
com.foreach.across.modules.web.ui.elements.builder.AbstractNodeViewElementBuilder<T,SELF>
com.foreach.across.modules.bootstrapui.elements.builder.AbstractHtmlSupportingNodeViewElementBuilder<T,SELF>
com.foreach.across.modules.bootstrapui.elements.builder.AbstractLinkSupportingNodeViewElementBuilder<com.foreach.across.modules.web.ui.elements.NodeViewElement,SELF>
com.foreach.across.modules.bootstrapui.components.builder.NavComponentBuilder<DefaultNavComponentBuilder>
com.foreach.across.modules.bootstrapui.components.builder.DefaultNavComponentBuilder
- All Implemented Interfaces:
com.foreach.across.modules.web.ui.elements.builder.HtmlViewElementBuilder<com.foreach.across.modules.web.ui.elements.NodeViewElement,,DefaultNavComponentBuilder> com.foreach.across.modules.web.ui.ViewElementBuilder<com.foreach.across.modules.web.ui.elements.NodeViewElement>
Builds a Bootstrap nav list structure for a
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.- Since:
- 1.1.0
- Author:
- Arne Vandamme
-
Nested Class Summary
Nested classes/interfaces inherited from class com.foreach.across.modules.bootstrapui.components.builder.NavComponentBuilder
NavComponentBuilder.SeparatorNested classes/interfaces inherited from class com.foreach.across.modules.web.ui.ViewElementBuilderSupport
com.foreach.across.modules.web.ui.ViewElementBuilderSupport.ElementOrBuilderNested classes/interfaces inherited from interface com.foreach.across.modules.web.ui.ViewElementBuilder
com.foreach.across.modules.web.ui.ViewElementBuilder.Wither<T extends com.foreach.across.modules.web.ui.ViewElementBuilder> -
Field Summary
Fields inherited from class com.foreach.across.modules.bootstrapui.components.builder.NavComponentBuilder
ATTR_ICON, ATTR_ICON_ONLY, ATTR_INSERT_SEPARATOR, ATTR_ITEM_VIEW_ELEMENT, ATTR_KEEP_AS_GROUP, ATTR_KEEP_GROUP_ITEM, ATTR_LINK_VIEW_ELEMENT, ATTR_VIEW_ELEMENT_WITHER, CTX_CURRENT_MENU_ITEMFields inherited from class com.foreach.across.modules.web.ui.ViewElementBuilderSupport
customTemplate, name -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected com.foreach.across.modules.web.ui.elements.NodeViewElementbuildMenu(com.foreach.across.modules.web.menu.Menu menuToRender, com.foreach.across.modules.web.ui.ViewElementBuilderContext builderContext) dropDownWither(com.foreach.across.modules.web.ui.ViewElement.WitherSetter<com.foreach.across.modules.web.ui.elements.HtmlViewElement> dropDownWither) Configure a wither method to be added to each dropdown item being generated.navbar()Render menu as navbar links.pills()Render menu as pills.Shorthand forreplaceGroupBySelectedItem(true).replaceGroupBySelectedItem(boolean replaceGroup) Iftrue, 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.simple()Render menu with no specific nav style.stacked()Render menu as stacked pills, with a dropright.tabs()Render menu as tabs.Methods inherited from class com.foreach.across.modules.bootstrapui.components.builder.NavComponentBuilder
addHtmlAttributes, addIconAndText, addItemLink, addViewElementIfAttributeExists, createElement, customizeViewElement, customizeViewElement, filter, findFirstIncludedChild, findItemToRender, getFirstNonGroupSelectedItem, htmlAttribute, htmlAttributesOf, includedItems, includePathAsDataAttribute, keepGroupsAsGroup, menu, menu, numberOfChildrenToInclude, shouldIncludeItem, shouldKeepAsGroup, witherAttributeMethods inherited from class com.foreach.across.modules.bootstrapui.elements.builder.AbstractLinkSupportingNodeViewElementBuilder
buildLink, linkBuilderMethods inherited from class com.foreach.across.modules.bootstrapui.elements.builder.AbstractHtmlSupportingNodeViewElementBuilder
escapeHtml, isEscapeHtml, resolveTextElement, toTextElementMethods inherited from class com.foreach.across.modules.web.ui.elements.builder.AbstractNodeViewElementBuilder
apply, attribute, attributes, clearAttributes, css, htmlId, removeAttribute, removeCssMethods inherited from class com.foreach.across.modules.web.ui.elements.builder.ContainerViewElementBuilderSupport
add, add, addAll, addFirst, addFirst, sortMethods inherited from class com.foreach.across.modules.web.ui.ViewElementBuilderSupport
build, configure, customTemplate, elementSupplier, elementSupplier, name, postProcess, postProcessor, registerWebResources, withMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface com.foreach.across.modules.web.ui.elements.builder.HtmlViewElementBuilder
data, removeDataMethods inherited from interface com.foreach.across.modules.web.ui.ViewElementBuilder
andThen, build, doWith, map, map, postProcess, postProcess
-
Constructor Details
-
DefaultNavComponentBuilder
public DefaultNavComponentBuilder()
-
-
Method Details
-
simple
Render menu with no specific nav style.- Returns:
- current builder
-
tabs
Render menu as tabs.- Returns:
- current builder
-
pills
Render menu as pills.- Returns:
- current builder
-
stacked
Render menu as stacked pills, with a dropright.- Returns:
- current builder
-
replaceGroupBySelectedItem
Shorthand forreplaceGroupBySelectedItem(true).- Returns:
- current builder
-
dropDownWither
public DefaultNavComponentBuilder dropDownWither(com.foreach.across.modules.web.ui.ViewElement.WitherSetter<com.foreach.across.modules.web.ui.elements.HtmlViewElement> dropDownWither) Configure a wither method to be added to each dropdown item being generated. Can be used to set for example the dropdown direction.- Returns:
- current builder
-
replaceGroupBySelectedItem
Iftrue, 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 optionalNavComponentBuilder.ATTR_ICONattribute of the selected item will be returned. Default behaviour is not to do this but it can be user friendly in a tab navigation.- Parameters:
replaceGroup- true to replace the group label- Returns:
- current builder
-