Class HorizontalMenu.ViewMenuItem

java.lang.Object
com.vaadin.flow.component.Component
com.vaadin.flow.component.Composite<T>
All Implemented Interfaces:
com.vaadin.flow.component.AttachNotifier, com.vaadin.flow.component.DetachNotifier, com.vaadin.flow.component.HasElement, com.vaadin.flow.component.HasStyle, com.vaadin.flow.component.shared.HasPrefix, com.vaadin.flow.component.shared.HasSuffix, com.vaadin.flow.component.shared.HasTooltip, MenuItem, Serializable
Enclosing class:
HorizontalMenu

public static class HorizontalMenu.ViewMenuItem extends HorizontalMenu.MenuItem
Represents an item which navigates to a view on click
See Also:
  • Field Details

    • viewClass

      protected Class<? extends View<?>> viewClass
    • routeParameters

      protected com.vaadin.flow.router.RouteParameters routeParameters
  • Constructor Details

  • Method Details

    • getUrlQueryParameters

      @Nullable public com.vaadin.flow.router.QueryParameters getUrlQueryParameters()
      Returns:
      query parameters of the view to navigate
    • setUrlQueryParameters

      public void setUrlQueryParameters(List<MenuItem.MenuItemParameter> queryParameters)
      Sets query parameters of the view to navigate.
      Parameters:
      queryParameters - query parameters
    • getRouteParameters

      @Nullable public com.vaadin.flow.router.RouteParameters getRouteParameters()
      Returns:
      route parameters of the view to navigate
    • setRouteParameters

      public void setRouteParameters(List<MenuItem.MenuItemParameter> routeParameters)
      Sets route parameters of the view to navigate.
      Parameters:
      routeParameters - route parameters
    • getViewClass

      @Nullable public Class<? extends View<?>> getViewClass()
      Returns:
      view class or null if not set
    • setViewClass

      public void setViewClass(Class<? extends View<?>> viewClass)
      Sets view class that should be shown when the user clicks on the menu item.
      Parameters:
      viewClass - view class to set
    • setClickHandler

      public com.vaadin.flow.shared.Registration setClickHandler(@Nullable Consumer<HorizontalMenu.MenuItem> clickHandler)
      Description copied from class: HorizontalMenu.MenuItem
      Sets click handler of the item.
      Overrides:
      setClickHandler in class HorizontalMenu.MenuItem
      Parameters:
      clickHandler - menu item click handler
      Returns:
      click handler registration