com.vaadin.navigator.
Class Navigator.PushStateManager
- java.lang.Object
-
- com.vaadin.navigator.Navigator.PushStateManager
-
All Implemented Interfaces:
Enclosing class:
public static class Navigator.PushStateManager extends Object implements NavigationStateManager
A
NavigationStateManager
using path info, HTML5 push state andPage.PopStateEvent
s to track views and enable listening to view changes. This manager can be enabled with UI annotationPushStateNavigation
.The part of path after UI's "root path" (UI's path without view identifier) is used as
View
s identifier. The rest of the path after the view name can be used by the developer for extra parameters for the View.This class is mostly for internal use by Navigator, and is only public and static to enable testing.
Since:
8.2
See Also:
-
-
Constructor Summary
Constructors Constructor Description PushStateManager(UI ui)
Creates a new PushStateManager.
-
Method Summary
All Methods Modifier and Type Method Description String
getState()
Returns the current navigation state including view name and any optional parameters.
void
setNavigator(Navigator navigator)
Sets the Navigator used with this state manager.
void
setState(String state)
Sets the current navigation state in the location URI or similar location, including view name and any optional parameters.
-
-
-
Constructor Detail
-
PushStateManager
public PushStateManager(UI ui)
Creates a new PushStateManager.
Parameters:
ui
- the UI where the Navigator is attached to
-
-
Method Detail
-
setNavigator
public void setNavigator(Navigator navigator)
Description copied from interface:
NavigationStateManager
Sets the Navigator used with this state manager. The state manager should notify the provided navigator of user-triggered navigation state changes by invoking
navigator.navigateTo(getState())
.navigator
parameter value could be null if previously set navigator is destroyed.This method should only be called by a Navigator.
Specified by:
setNavigator
in interfaceNavigationStateManager
-
getState
public String getState()
Description copied from interface:
NavigationStateManager
Returns the current navigation state including view name and any optional parameters.
Specified by:
getState
in interfaceNavigationStateManager
Returns:
current view and parameter string, not null
-
setState
public void setState(String state)
Description copied from interface:
NavigationStateManager
Sets the current navigation state in the location URI or similar location, including view name and any optional parameters.
This method should be only called by a Navigator.
Specified by:
setState
in interfaceNavigationStateManager
Parameters:
state
- new view and parameter string, not null
-
-