public static class Navigator.PushStateManager extends Object implements NavigationStateManager
NavigationStateManager using path info, HTML5 push state and
Page.PopStateEvents to track views and enable listening to view
changes. This manager can be enabled with UI annotation
PushStateNavigation.
The part of path after UI's "root path" (UI's path without view
identifier) is used as Views 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.
| Constructor and Description |
|---|
PushStateManager(UI ui)
Creates a new PushStateManager.
|
| Modifier and Type | Method and 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.
|
public PushStateManager(UI ui)
ui - the UI where the Navigator is attached topublic void setNavigator(Navigator navigator)
NavigationStateManagernavigator.navigateTo(getState()).
navigator parameter value could be null if previously set
navigator is destroyed.
This method should only be called by a Navigator.
setNavigator in interface NavigationStateManagerpublic String getState()
NavigationStateManagergetState in interface NavigationStateManagerpublic void setState(String state)
NavigationStateManagerThis method should be only called by a Navigator.
setState in interface NavigationStateManagerstate - new view and parameter string, not nullCopyright © 2018 Vaadin Ltd. All rights reserved.