Class AbstractViewNavigator

java.lang.Object
io.jmix.flowui.view.navigation.AbstractViewNavigator
Direct Known Subclasses:
DetailViewNavigator, ListViewNavigator, ViewNavigator

public abstract class AbstractViewNavigator extends Object
Provides a fluent interface to configure navigation parameters and navigate to a View.

An instance of this class should be obtained through ViewNavigators.view(String).

  • Field Details

    • origin

      protected final View<?> origin
    • handler

      protected final Consumer<? extends AbstractViewNavigator> handler
    • viewId

      protected String viewId
    • routeParameters

      protected com.vaadin.flow.router.RouteParameters routeParameters
    • queryParameters

      protected com.vaadin.flow.router.QueryParameters queryParameters
    • backwardNavigation

      protected boolean backwardNavigation
  • Constructor Details

  • Method Details

    • getOrigin

      public View<?> getOrigin()
      Returns:
      invoking view
    • withViewId

      public AbstractViewNavigator withViewId(@Nullable String viewId)
      Sets the opened view by id.
      Parameters:
      viewId - identifier of the view as specified in the ViewController annotation
      Returns:
      this instance for chaining
    • withRouteParameters

      public AbstractViewNavigator withRouteParameters(@Nullable com.vaadin.flow.router.RouteParameters routeParameters)
      Sets URL route parameters.
      Parameters:
      routeParameters - route parameters
      Returns:
      this instance for chaining
    • withQueryParameters

      public AbstractViewNavigator withQueryParameters(@Nullable com.vaadin.flow.router.QueryParameters queryParameters)
      Sets URL query parameters.
      Parameters:
      queryParameters - query parameters
      Returns:
      this instance for chaining
    • withBackwardNavigation

      public AbstractViewNavigator withBackwardNavigation(boolean backwardNavigation)
      Sets whether the current URL should be navigated to when the opened view is closed.
      Parameters:
      backwardNavigation - whether the current URL should be registered for backward navigation
      Returns:
      this instance for chaining
    • getViewId

      public Optional<String> getViewId()
      Returns:
      identifier of the opened view as specified in the ViewController annotation
    • getViewClass

      public Optional<Class<? extends View>> getViewClass()
      Returns:
      opened view class
    • getRouteParameters

      public Optional<com.vaadin.flow.router.RouteParameters> getRouteParameters()
      Returns:
      URL route parameters
    • getQueryParameters

      public Optional<com.vaadin.flow.router.QueryParameters> getQueryParameters()
      Returns:
      URL query parameters
    • isBackwardNavigation

      public boolean isBackwardNavigation()
      Returns:
      whether the current URL should be navigated to when the opened view is closed