com.vaadin.flow.router.internal.
Class AbstractNavigationStateRenderer
- java.lang.Object
-
- com.vaadin.flow.router.internal.AbstractNavigationStateRenderer
-
All Implemented Interfaces:
Direct Known Subclasses:
public abstract class AbstractNavigationStateRenderer extends Object implements NavigationHandler
Base class for navigation handlers that target a navigation state.
For internal use only. May be renamed or removed in a future release.
Since:
1.0
Author:
Vaadin Ltd
See Also:
-
-
Constructor Summary
Constructors Constructor and Description AbstractNavigationStateRenderer(NavigationState navigationState)
Creates a new renderer for the given navigation state.
-
Method Summary
All Methods Modifier and Type Method and Description protected abstract boolean
eventActionsSupported()
Checks whether this renderer should reroute or postpone navigation based on results from event listeners.
NavigationState
getNavigationState()
Gets the targeted navigation state.
protected abstract List<Class<? extends RouterLayout>>
getRouterLayoutTypes(Class<? extends Component> routeTargetType, Router router)
Gets the router layout types to show for the given route target type, starting from the parent layout immediately wrapping the route target type.
int
handle(NavigationEvent event)
Handles the navigation event.
protected abstract void
notifyNavigationTarget(Component componentInstance, NavigationEvent navigationEvent, BeforeEnterEvent beforeEnterEvent, LocationChangeEvent locationChangeEvent)
Notify the navigation target about the status of the navigation.
static void
purgeInactiveUIPreservedChainCache(UI inactiveUI)
Removes preserved component cache for an inactive UI.
-
-
-
Constructor Detail
-
AbstractNavigationStateRenderer
public AbstractNavigationStateRenderer(NavigationState navigationState)
Creates a new renderer for the given navigation state.
Parameters:
navigationState
- the target navigation state
-
-
Method Detail
-
getNavigationState
public NavigationState getNavigationState()
Gets the targeted navigation state.
Returns:
the targeted navigation state
-
handle
public int handle(NavigationEvent event)
Description copied from interface:
NavigationHandler
Handles the navigation event.
Specified by:
handle
in interfaceNavigationHandler
Parameters:
event
- the navigation event to handleReturns:
the HTTP status code to return to the client if handling an initial rendering request
-
notifyNavigationTarget
protected abstract void notifyNavigationTarget(Component componentInstance, NavigationEvent navigationEvent, BeforeEnterEvent beforeEnterEvent, LocationChangeEvent locationChangeEvent)
Notify the navigation target about the status of the navigation.
Parameters:
componentInstance
- the navigation target instancenavigationEvent
- the low level navigation event that is being processedbeforeEnterEvent
- the before enter event that will be fired unless navigation is reroutedlocationChangeEvent
- the location change event that will be fired unless navigation is rerouted
-
getRouterLayoutTypes
protected abstract List<Class<? extends RouterLayout>> getRouterLayoutTypes(Class<? extends Component> routeTargetType, Router router)
Gets the router layout types to show for the given route target type, starting from the parent layout immediately wrapping the route target type.
Parameters:
routeTargetType
- component type that will be shownrouter
- used router instanceReturns:
a list of parent
RouterLayout
types, notnull
-
eventActionsSupported
protected abstract boolean eventActionsSupported()
Checks whether this renderer should reroute or postpone navigation based on results from event listeners. Furthermore, the before leave event is not fired at all if event actions are not supported.
Returns:
true
to support event actions;false
otherwise.
-
purgeInactiveUIPreservedChainCache
public static void purgeInactiveUIPreservedChainCache(UI inactiveUI)
Removes preserved component cache for an inactive UI.
Parameters:
inactiveUI
- the inactive UIThrows:
IllegalStateException
- if the UI is not in closing state
-
-