Class DetailViewNavigator<E>

java.lang.Object
io.jmix.flowui.view.navigation.AbstractViewNavigator
io.jmix.flowui.view.navigation.DetailViewNavigator<E>
Direct Known Subclasses:
DetailViewClassNavigator

public class DetailViewNavigator<E> extends AbstractViewNavigator
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: 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<?>> DetailViewClassNavigator<E,V> withViewClass(Class<V> viewClass)
      Sets the opened view by its class.
      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: AbstractViewNavigator
      Sets URL route parameters.
      Overrides:
      withRouteParameters in class AbstractViewNavigator
      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: AbstractViewNavigator
      Sets URL query parameters.
      Overrides:
      withQueryParameters in class AbstractViewNavigator
      Parameters:
      queryParameters - query parameters
      Returns:
      this instance for chaining
    • withBackwardNavigation

      public DetailViewNavigator<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
    • 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