Class BreadcrumbNavComponentBuilder

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,BreadcrumbNavComponentBuilder>, com.foreach.across.modules.web.ui.ViewElementBuilder<com.foreach.across.modules.web.ui.elements.NodeViewElement>

public class BreadcrumbNavComponentBuilder extends NavComponentBuilder<BreadcrumbNavComponentBuilder>
Renders the selected path of a Menu to a breadcrumb list.
Since:
1.1.0
Author:
Arne Vandamme
  • Constructor Details

    • BreadcrumbNavComponentBuilder

      public BreadcrumbNavComponentBuilder()
  • Method Details

    • iconAllowedLevels

      public BreadcrumbNavComponentBuilder iconAllowedLevels(int iconLevels)
      Set the number of levels (breadcrumb segments) for which the icon will be rendered if there is one. By default all items will have their icons rendered.

      Set to 0 if you don't want to render any icons.

      Parameters:
      iconLevels - number of levels for which icon should be rendered
      Returns:
      current builder
      See Also:
      • iconOnlyLevels
    • iconOnlyLevels

      public BreadcrumbNavComponentBuilder iconOnlyLevels(int iconOnlyLevels)
      Set the number of levels (breadcrumb segments) that will be rendered as just the icon if NavComponentBuilder.ATTR_ICON_ONLY is true. By default all segments might be rendered this way.

      Set this attribute to 1 if you want to allow only the root item to be rendered as an icon. Set to 0 if you never want an item to be rendered as only the icon in the breadcrumb.

      Parameters:
      iconOnlyLevels - number of levels for which icon should be rendered
      Returns:
      current builder
      See Also:
    • buildMenu

      protected com.foreach.across.modules.web.ui.elements.NodeViewElement buildMenu(com.foreach.across.modules.web.menu.Menu menu, com.foreach.across.modules.web.ui.ViewElementBuilderContext builderContext)
      Specified by:
      buildMenu in class NavComponentBuilder<BreadcrumbNavComponentBuilder>
    • addBreadcrumbSegment

      protected void addBreadcrumbSegment(com.foreach.across.modules.web.ui.elements.NodeViewElement list, com.foreach.across.modules.web.menu.Menu item, com.foreach.across.modules.web.ui.ViewElementBuilderContext builderContext, int level, boolean isLastItem)
    • addItemLink

      protected LinkViewElement addItemLink(com.foreach.across.modules.web.ui.elements.NodeViewElement container, com.foreach.across.modules.web.menu.Menu item, boolean iconAllowed, boolean iconOnly, com.foreach.across.modules.web.ui.ViewElementBuilderContext builderContext)
      Overrides:
      addItemLink in class NavComponentBuilder<BreadcrumbNavComponentBuilder>