Class ViewBreadcrumbs

java.lang.Object
com.vaadin.flow.component.Component
com.vaadin.flow.component.Composite<JmixBreadcrumbs>
io.jmix.tabbedmode.component.breadcrumbs.ViewBreadcrumbs
All Implemented Interfaces:
com.vaadin.flow.component.AttachNotifier, com.vaadin.flow.component.DetachNotifier, com.vaadin.flow.component.HasElement, com.vaadin.flow.component.HasStyle, Serializable, org.springframework.beans.factory.Aware, org.springframework.context.ApplicationContextAware

public class ViewBreadcrumbs extends com.vaadin.flow.component.Composite<JmixBreadcrumbs> implements org.springframework.context.ApplicationContextAware
A wrapper component for JmixBreadcrumbs that manages a stack of views.
See Also:
  • Field Details

  • Constructor Details

    • ViewBreadcrumbs

      public ViewBreadcrumbs()
  • Method Details

    • setApplicationContext

      public void setApplicationContext(org.springframework.context.ApplicationContext applicationContext) throws org.springframework.beans.BeansException
      Specified by:
      setApplicationContext in interface org.springframework.context.ApplicationContextAware
      Throws:
      org.springframework.beans.BeansException
    • initContent

      protected JmixBreadcrumbs initContent()
      Overrides:
      initContent in class com.vaadin.flow.component.Composite<JmixBreadcrumbs>
    • setNavigationHandler

      public void setNavigationHandler(@Nullable Consumer<ViewBreadcrumbs.BreadcrumbsNavigationContext> handler)
      Sets a handler to be invoked when an individual breadcrumb is clicked.
      Parameters:
      handler - a handler to set
    • getViews

      public Deque<View<?>> getViews()
      Returns all views represented by this breadcrumbs component.
      Returns:
      a collection containing all View instances
    • getCurrentViewInfo

      @Nullable public ViewBreadcrumbs.ViewInfo getCurrentViewInfo()
      returns the information about the current view and its associated location. If no views are present in the stack, returns null.
      Returns:
      an instance of ViewBreadcrumbs.ViewInfo containing the current view and its location, or null if no views are available.
    • addView

      public void addView(View<?> view, com.vaadin.flow.router.Location location)
      Adds the given View to the view stack, registers Location mapping and updates visibility state.
      Parameters:
      view - a view to add
      location - associated location
    • createBreadcrumb

      protected JmixBreadcrumb createBreadcrumb(View<?> view)
    • removeView

      public void removeView()
      Removes the last View from the view stack and updates visibility state.
    • updateViewLocation

      public void updateViewLocation(View<?> view, com.vaadin.flow.router.Location location)
      Updates Location mapping of the given View.
      Parameters:
      view - view to update the location mapping for
      location - a new location
    • findMappings

      protected Optional<ViewBreadcrumbs.BreadcrumbMappings> findMappings(View<?> view)
    • findView

      protected Optional<View<?>> findView(JmixBreadcrumb breadcrumb)
    • setVisible

      public void setVisible(boolean visible)
      Overrides:
      setVisible in class com.vaadin.flow.component.Component
    • setVisibleInternal

      protected void setVisibleInternal(boolean visible)
    • updateVisibility

      protected void updateVisibility()