Class DetailViewNavigator<E>

java.lang.Object
io.jmix.flowui.view.navigation.ViewNavigator
io.jmix.flowui.view.navigation.DetailViewNavigator<E>

public class DetailViewNavigator<E> extends ViewNavigator
Provides a fluent interface to configure navigation parameters and navigate to an entity detail View.

An instance of this class should be obtained through ViewNavigators.detailView(Class) and its overloaded variants.

  • Field Details

    • entityClass

      protected final Class<E> entityClass
    • editedEntity

      protected E editedEntity
    • readOnly

      protected boolean readOnly
    • mode

      protected DetailViewMode mode
  • Constructor Details

  • Method Details

    • newEntity

      public DetailViewNavigator<E> newEntity()
    • editEntity

      public DetailViewNavigator<E> editEntity(E entity)
    • withViewId

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

      public DetailViewNavigator<E> withViewClass(@Nullable Class<? extends View> viewClass)
      Description copied from class: ViewNavigator
      Sets the opened view by its class.
      Overrides:
      withViewClass in class ViewNavigator
      Parameters:
      viewClass - view class
      Returns:
      this instance for chaining
    • withRouteParameters

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

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

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

      public DetailViewNavigator<E> withReadOnly(boolean readOnly)
    • getEntityClass

      public Class<E> getEntityClass()
      Returns:
      entity class of the detail view
    • getEditedEntity

      public Optional<E> getEditedEntity()
      Returns:
      entity instance shown by the detail view
    • getMode

      public DetailViewMode getMode()
      Returns:
      the detail view purpose (create or edit an entity)
    • isReadOnly

      public boolean isReadOnly()
      Returns:
      whether a view should be opened in read-only mode