Class WNavigationBar


public class WNavigationBar
extends WTemplate
A navigation bar.

Note: WNavigationBar is currently only styled in the Bootstrap themes.

  • Constructor Details

  • Method Details

    • setTitle

      public void setTitle​(java.lang.CharSequence title, WLink link)
      Sets a title.

      The title may optionally link to a 'homepage'.

    • setTitle

      public final void setTitle​(java.lang.CharSequence title)
      Sets a title.

      Calls setTitle(title, new WLink())

    • setResponsive

      public void setResponsive​(boolean responsive)
      Sets whether the navigation bar will respond to screen size.

      For screens that are less wide, the navigation bar can be rendered different (more compact and allowing for vertical menu layouts).

    • addMenu

      public void addMenu​(WMenu menu, AlignmentFlag alignment)
      Adds a menu to the navigation bar.

      Typically, a navigation bar will contain at least one menu which implements the top-level navigation options allowed by the navigation bar.

      The menu may be aligned to the left or to the right of the navigation bar.

    • addMenu

      public final void addMenu​(WMenu menu)
      Adds a menu to the navigation bar.

      Calls addMenu(menu, AlignmentFlag.AlignLeft)

    • addFormField

      public void addFormField​(WWidget widget, AlignmentFlag alignment)
      Adds a form field to the navigation bar.

      In some cases, one may want to add a few form fields to the navigation bar (e.g. for a compact login option).

    • addFormField

      public final void addFormField​(WWidget widget)
      Adds a form field to the navigation bar.

      Calls addFormField(widget, AlignmentFlag.AlignLeft)

    • addSearch

      public void addSearch​(WLineEdit field, AlignmentFlag alignment)
      Adds a search widget to the navigation bar.

      This is not so different from addFormField(), except that the form field may be styled differently to indicate a search function.

    • addSearch

      public final void addSearch​(WLineEdit field)
      Adds a search widget to the navigation bar.

      Calls addSearch(field, AlignmentFlag.AlignLeft)

    • addWidget

      public void addWidget​(WWidget widget, AlignmentFlag alignment)
      Adds a widget to the navigation bar.

      Any other widget may be added to the navigation bar, although they may require special CSS style to blend well with the navigation bar style.

    • addWidget

      public final void addWidget​(WWidget widget)
      Adds a widget to the navigation bar.

      Calls addWidget(widget, AlignmentFlag.AlignLeft)

    • getCreateCollapseButton

      protected WInteractWidget getCreateCollapseButton()
    • getCreateExpandButton

      protected WInteractWidget getCreateExpandButton()