Package io.jmix.flowui.view.navigation
Class ViewClassNavigator<V extends View<?>>
java.lang.Object
io.jmix.flowui.view.navigation.AbstractViewNavigator
io.jmix.flowui.view.navigation.ViewNavigator
io.jmix.flowui.view.navigation.ViewClassNavigator<V>
- All Implemented Interfaces:
SupportsAfterViewNavigationHandler<V>
public class ViewClassNavigator<V extends View<?>>
extends ViewNavigator
implements SupportsAfterViewNavigationHandler<V>
Provides a fluent interface to configure navigation parameters and navigate to a
View
.
An instance of this class should be obtained through ViewNavigators.view(Class)
.
-
Nested Class Summary
Nested classes/interfaces inherited from interface io.jmix.flowui.view.navigation.SupportsAfterViewNavigationHandler
SupportsAfterViewNavigationHandler.AfterViewNavigationEvent<V>
-
Field Summary
Modifier and TypeFieldDescriptionFields inherited from class io.jmix.flowui.view.navigation.AbstractViewNavigator
backwardNavigation, handler, origin, queryParameters, routeParameters, viewId
-
Constructor Summary
ModifierConstructorDescriptionprotected
ViewClassNavigator
(ViewNavigator viewNavigator, Class<V> viewClass) ViewClassNavigator
(View<?> origin, Consumer<? extends ViewNavigator> handler, Class<V> viewClass) ViewClassNavigator
(Consumer<? extends ViewNavigator> handler, Class<V> viewClass) Deprecated, for removal: This API element is subject to removal in a future version. -
Method Summary
Modifier and TypeMethodDescriptionwithAfterNavigationHandler
(Consumer<SupportsAfterViewNavigationHandler.AfterViewNavigationEvent<V>> handler) Adds a handler that will be invoked if navigation to a view actually happened.withBackwardNavigation
(boolean backwardNavigation) Sets whether the current URL should be navigated to when the opened view is closed.withQueryParameters
(com.vaadin.flow.router.QueryParameters queryParameters) Sets URL query parameters.withRouteParameters
(com.vaadin.flow.router.RouteParameters routeParameters) Sets URL route parameters.withViewId
(String viewId) Sets the opened view by id.Methods inherited from class io.jmix.flowui.view.navigation.ViewNavigator
withViewClass
Methods inherited from class io.jmix.flowui.view.navigation.AbstractViewNavigator
getOrigin, getQueryParameters, getRouteParameters, getViewId, isBackwardNavigation, navigate
-
Field Details
-
viewClass
-
-
Constructor Details
-
ViewClassNavigator
@Deprecated(since="2.3", forRemoval=true) public ViewClassNavigator(Consumer<? extends ViewNavigator> handler, Class<V> viewClass) Deprecated, for removal: This API element is subject to removal in a future version. -
ViewClassNavigator
public ViewClassNavigator(View<?> origin, Consumer<? extends ViewNavigator> handler, Class<V> viewClass)
-
-
Method Details
-
withViewId
Description copied from class:AbstractViewNavigator
Sets the opened view by id.- Overrides:
withViewId
in classViewNavigator
- Parameters:
viewId
- identifier of the view as specified in theViewController
annotation- Returns:
- this instance for chaining
-
withRouteParameters
public ViewClassNavigator<V> withRouteParameters(@Nullable com.vaadin.flow.router.RouteParameters routeParameters) Description copied from class:AbstractViewNavigator
Sets URL route parameters.- Overrides:
withRouteParameters
in classViewNavigator
- Parameters:
routeParameters
- route parameters- Returns:
- this instance for chaining
-
withQueryParameters
public ViewClassNavigator<V> withQueryParameters(@Nullable com.vaadin.flow.router.QueryParameters queryParameters) Description copied from class:AbstractViewNavigator
Sets URL query parameters.- Overrides:
withQueryParameters
in classViewNavigator
- Parameters:
queryParameters
- query parameters- Returns:
- this instance for chaining
-
getViewClass
- Overrides:
getViewClass
in classAbstractViewNavigator
- Returns:
- opened view class
-