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

public class DefaultNavComponentBuilder extends NavComponentBuilder<DefaultNavComponentBuilder>
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
  • Constructor Details

    • DefaultNavComponentBuilder

      public DefaultNavComponentBuilder()
  • Method Details

    • simple

      public DefaultNavComponentBuilder 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

      public DefaultNavComponentBuilder stacked()
      Render menu as stacked pills, with a dropright.
      Returns:
      current builder
    • replaceGroupBySelectedItem

      public DefaultNavComponentBuilder replaceGroupBySelectedItem()
      Shorthand for replaceGroupBySelectedItem(true).
      Returns:
      current builder
    • replaceGroupBySelectedItem

      public 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. 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.
      Parameters:
      replaceGroup - true to replace the group label
      Returns:
      current builder
    • buildMenu

      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)
      Specified by:
      buildMenu in class NavComponentBuilder<DefaultNavComponentBuilder>