Class ReadViewNavigator<E>

java.lang.Object
io.jmix.flowui.view.navigation.AbstractViewNavigator
io.jmix.flowui.view.navigation.ReadViewNavigator<E>
Type Parameters:
E - the type of the entity shown by the view
Direct Known Subclasses:
ReadViewClassNavigator

public class ReadViewNavigator<E> extends AbstractViewNavigator
Provides a fluent interface for navigating to a read view of an entity.
  • Field Details

    • entityClass

      protected final Class<E> entityClass
    • entity

      protected @Nullable E entity
  • Constructor Details

  • Method Details

    • readEntity

      public ReadViewNavigator<E> readEntity(E entity)
      Sets the entity instance to show.
      Parameters:
      entity - entity instance to show
      Returns:
      this instance for chaining
    • withViewId

      public ReadViewNavigator<E> withViewId(@Nullable String viewId)
      Description copied from class: AbstractViewNavigator
      Sets the opened view by id.
      Overrides:
      withViewId in class AbstractViewNavigator
      Parameters:
      viewId - identifier of the view as specified in the ViewController annotation
      Returns:
      this instance for chaining
    • withViewClass

      public <V extends View<?>> ReadViewClassNavigator<E,V> withViewClass(Class<V> viewClass)
      Sets the opened view by its class.
      Parameters:
      viewClass - view class
      Returns:
      this instance for chaining
    • withRouteParameters

      public ReadViewNavigator<E> withRouteParameters(@Nullable com.vaadin.flow.router.RouteParameters routeParameters)
      Description copied from class: AbstractViewNavigator
      Sets URL route parameters.
      Overrides:
      withRouteParameters in class AbstractViewNavigator
      Parameters:
      routeParameters - route parameters
      Returns:
      this instance for chaining
    • withQueryParameters

      public ReadViewNavigator<E> withQueryParameters(@Nullable com.vaadin.flow.router.QueryParameters queryParameters)
      Description copied from class: AbstractViewNavigator
      Sets URL query parameters.
      Overrides:
      withQueryParameters in class AbstractViewNavigator
      Parameters:
      queryParameters - query parameters
      Returns:
      this instance for chaining
    • withBackwardNavigation

      public ReadViewNavigator<E> withBackwardNavigation(boolean backwardNavigation)
      Description copied from class: AbstractViewNavigator
      Sets whether the current URL should be navigated to when the opened view is closed.
      Overrides:
      withBackwardNavigation in class AbstractViewNavigator
      Parameters:
      backwardNavigation - whether the current URL should be registered for backward navigation
      Returns:
      this instance for chaining
    • getEntityClass

      public Class<E> getEntityClass()
      Returns:
      the class of the shown entity
    • getEntity

      public Optional<E> getEntity()
      Returns:
      the entity instance to show, or an empty Optional if it is not set