Interface NavRenderer

All Known Implementing Classes:
ExpandingTouchNavRenderer, FlyoutRailNavRenderer, HeaderTabsNavRenderer, ScrollingTouchNavRenderer, SideNavDrawerNavRenderer, SideRailNavRenderer, TouchBarNavRenderer

public interface NavRenderer
Builds and updates the nav-item content for one of AppNavLayout's five device/orientation scenarios (desktop, tablet portrait, tablet landscape, phone portrait, phone landscape), placing it into whichever of AppNavLayout's named locations (see NavSlots) is appropriate. Register an implementation via AppNavLayout.setDesktopNavRenderer(Supplier), AppNavLayout.setTabletPortraitNavRenderer(Supplier), AppNavLayout.setTabletLandscapeNavRenderer(Supplier) (or the AppNavLayout.setTabletNavRenderer(Supplier) convenience setter), AppNavLayout.setPhonePortraitNavRenderer(Supplier), or AppNavLayout.setPhoneLandscapeNavRenderer(Supplier) (or AppNavLayout.setPhoneNavRenderer(Supplier)) to replace the default for that scenario.

Deliberately decoupled from nav organization: a renderer receives an already-configured NavGrouper and never influences or queries how the tree is grouped.

  • Method Summary

    Modifier and Type
    Method
    Description
    The chrome this renderer requires — determines which NavStrategy gets built for whichever scenario this renderer is configured for.
    default String
    The rail's own width, as a CSS length — consulted only when navType() is NavType.RAIL.
    void
    Builds or updates this renderer's content for the current nav state.
  • Method Details

    • render

      void render(NavRenderContext context)
      Builds or updates this renderer's content for the current nav state. Called once when this scenario becomes active, again on every completed navigation, and again whenever nav configuration changes (grouper swap, path matcher change). The implementation decides which slot(s) in context.slots() to populate and how — including any overflow or drill-down scaffolding it needs (a "More…" popover, a chevron, a swipeable container, etc).
    • railWidth

      default String railWidth()
      The rail's own width, as a CSS length — consulted only when navType() is NavType.RAIL. Default matches the built-in rail renderers' own icon-and-label-only content. Override when a renderer's items need more (or less) horizontal room than that — e.g. FlyoutRailNavRenderer's own trailing chevron box.