public class NavigatorActuator<N extends com.vaadin.navigator.Navigator & ViewNavigatorAdapter> extends Object implements com.vaadin.navigator.ViewDisplay
ViewNavigator specific logic to a NavigatorViewNavigator,
DefaultViewNavigator,
Serialized Form| Modifier and Type | Field and Description |
|---|---|
static int |
DEFAULT_NAVIGATION_HISTORY_LIMIT
Default navigation history limit
|
| Constructor and Description |
|---|
NavigatorActuator(N navigator)
Constructor
|
| Modifier and Type | Method and Description |
|---|---|
com.vaadin.navigator.ViewProvider |
addViewProvider(com.vaadin.navigator.ViewProvider provider)
Register and adapt a
ViewProvider |
String |
buildNavigationState(String viewName,
Map<String,Object> parameters)
Build a full navigation state String using given
viewName and appending any parameter in serialized
form |
String |
getCurrentViewName()
Get current (active) view name in navigator
|
com.vaadin.navigator.ViewDisplay |
getDefaultViewDisplay()
Default view display, i.e. the ViewDisplay to use to display Views when is not requested to display View in a
Window
|
String |
getDefaultViewName()
Get the optional default view name.
|
Consumer<ViewWindowConfigurator> |
getDefaultViewWindowConfigurator()
Get the default view window configurator.
|
Optional<ViewClassProvider> |
getViewClassProvider(com.vaadin.navigator.ViewProvider provider)
Get the
ViewClassProvider bound to given ViewProvider, if available. |
ViewConfiguration |
getViewConfiguration(Class<? extends com.vaadin.navigator.View> viewClass) |
Optional<ViewConfiguration> |
getViewConfiguration(String navigationState)
Get the
ViewConfiguration which corresponds to the View represented by the given
navigationState, if available. |
com.vaadin.navigator.ViewDisplay |
initNavigator(com.vaadin.ui.UI ui,
com.vaadin.navigator.ViewDisplay display)
Init actuator
|
boolean |
isAuthenticationEnabled()
Get whether the support for
Authenticate annotation on Views or UI is enabled. |
boolean |
isNavigateToDefaultViewWhenViewNotAvailable()
Gets whether to navigate to default view (if setted) when a view is not available from current navigation state
|
boolean |
navigateBack()
Navigate to previous View, if available
|
com.vaadin.ui.Window |
navigateInWindow(String viewName,
Consumer<ViewWindowConfigurator> windowConfiguration,
Map<String,Object> parameters)
Navigate to the
View identified by given viewName using the same behaviour of
navigateTo(String) but rendering the View contents in an application Window, using optional
windowConfiguration to setup Window features. |
void |
navigateTo(String navigationState)
Navigate to given navigation state
|
void |
navigateTo(com.vaadin.navigator.View view,
String viewName,
String parameters)
Navigate to given View
|
void |
navigateToDefault()
Navigate to default View, if available
|
void |
postUpdateNavigationState(com.vaadin.navigator.ViewChangeListener.ViewChangeEvent event)
Method to call after navigation state update
|
void |
preAfterViewChange(com.vaadin.navigator.ViewChangeListener.ViewChangeEvent event) |
com.vaadin.navigator.ViewProvider |
removeViewProvider(com.vaadin.navigator.ViewProvider provider)
Unregister a
ViewProvider |
void |
setAuthenticationEnabled(boolean authenticationEnabled)
Set whether the support for
Authenticate annotation on Views or UI is enabled. |
void |
setDefaultViewName(String defaultViewName)
Set the default view name.
|
void |
setDefaultViewWindowConfigurator(Consumer<ViewWindowConfigurator> defaultViewWindowConfigurator)
Set the default view window configurator
|
void |
setMaxNavigationHistorySize(int maxSize)
Set navigation history max size
|
void |
setNavigateToDefaultViewWhenViewNotAvailable(boolean navigateToDefaultViewWhenViewNotAvailable)
Set whether to navigate to default view (if setted) when a view is not available from current navigation state
|
void |
setViewClassProvider(com.vaadin.navigator.ViewProvider provider,
ViewClassProvider viewClassProvider)
Set the
ViewClassProvider bound to given ViewProvider. |
void |
showView(com.vaadin.navigator.View view) |
public static final int DEFAULT_NAVIGATION_HISTORY_LIMIT
public NavigatorActuator(N navigator)
navigator - Concrete Navigatorpublic com.vaadin.navigator.ViewDisplay initNavigator(com.vaadin.ui.UI ui,
com.vaadin.navigator.ViewDisplay display)
ui - Navigator UIdisplay - Navigator ViewDisplaypublic com.vaadin.navigator.ViewDisplay getDefaultViewDisplay()
public void showView(com.vaadin.navigator.View view)
showView in interface com.vaadin.navigator.ViewDisplaypublic void setMaxNavigationHistorySize(int maxSize)
maxSize - Max size of retained navigation fragmentspublic com.vaadin.navigator.ViewProvider addViewProvider(com.vaadin.navigator.ViewProvider provider)
ViewProviderprovider - ViewProvider to addpublic com.vaadin.navigator.ViewProvider removeViewProvider(com.vaadin.navigator.ViewProvider provider)
ViewProviderprovider - ViewProvider to removepublic void setViewClassProvider(com.vaadin.navigator.ViewProvider provider,
ViewClassProvider viewClassProvider)
ViewClassProvider bound to given ViewProvider.provider - View provider (not null)viewClassProvider - View class providerpublic Optional<ViewClassProvider> getViewClassProvider(com.vaadin.navigator.ViewProvider provider)
ViewClassProvider bound to given ViewProvider, if available.provider - View providerpublic boolean isNavigateToDefaultViewWhenViewNotAvailable()
true to navigate to default view (if setted) when a view is not available from current
navigation statepublic void setNavigateToDefaultViewWhenViewNotAvailable(boolean navigateToDefaultViewWhenViewNotAvailable)
navigateToDefaultViewWhenViewNotAvailable - true to navigate to default view (if setted) when a
view is not available from current navigation statepublic Consumer<ViewWindowConfigurator> getDefaultViewWindowConfigurator()
null if not availablepublic void setDefaultViewWindowConfigurator(Consumer<ViewWindowConfigurator> defaultViewWindowConfigurator)
defaultViewWindowConfigurator - the default view window configurator to setpublic void navigateTo(String navigationState)
navigationState - Navigation statepublic void navigateTo(com.vaadin.navigator.View view,
String viewName,
String parameters)
view - View instanceviewName - View nameparameters - View parameterspublic boolean navigateBack()
throws ViewNavigator.ViewNavigationException
ViewNavigator.ViewNavigationException - Navigation errorpublic void navigateToDefault()
throws ViewNavigator.ViewNavigationException
ViewNavigator.ViewNavigationException - Navigation errorpublic com.vaadin.ui.Window navigateInWindow(String viewName, Consumer<ViewWindowConfigurator> windowConfiguration, Map<String,Object> parameters) throws ViewNavigator.ViewNavigationException
View identified by given viewName using the same behaviour of
navigateTo(String) but rendering the View contents in an application Window, using optional
windowConfiguration to setup Window features.viewName - View namewindowConfiguration - Optional Window configuration settingsparameters - Optional view parametersViewNavigator.ViewNavigationException - View with given name cannot be found or other view handling errorpublic void postUpdateNavigationState(com.vaadin.navigator.ViewChangeListener.ViewChangeEvent event)
event - View change eventpublic void preAfterViewChange(com.vaadin.navigator.ViewChangeListener.ViewChangeEvent event)
public String getDefaultViewName()
View with given defaultViewName is valid and
provided by registered ViewProviders, it is used as target of ViewNavigator.navigateToDefault() method
and as a fallback by ViewNavigator.navigateBack() method if no other View is available in history.public void setDefaultViewName(String defaultViewName)
View with given defaultViewName is valid and provided by
registered ViewProviders, it is used as target of ViewNavigator.navigateToDefault() method and as a
fallback by ViewNavigator.navigateBack() method if no other View is available in history.defaultViewName - the default view name to setpublic String getCurrentViewName()
null if no view is currently active in navigatorpublic boolean isAuthenticationEnabled()
Authenticate annotation on Views or UI is enabled.true if the support for Authenticate annotation on Views or UI is
enabledsetAuthenticationEnabled(boolean)public void setAuthenticationEnabled(boolean authenticationEnabled)
Authenticate annotation on Views or UI is enabled.
If enabled, the navigator will check the Authenticate annotation on Views or UI during
navigation, and if present, requires the presence of an authenticated AuthContext obtained through
AuthContext.getCurrent(). If an AuthContext is present but not authenticated, try to perform
authentication using current VaadinRequest and the optional authentication schemes specified using
Authenticate.schemes(). If the authentication is not successfull and a valid redirect URI is provided
through Authenticate.redirectURI(), the navigation is redirected to that URI. If the URI does not specify
a scheme, or the scheme is equal to view://, the navigation is redirected to the navigation state
following the view:// scheme or to the navigation state equal to the
The authentication support is enabled by default.
Authenticate.redirectURI() attribute if a URI scheme is not specified.authenticationEnabled - true to enable the Authenticate support, false to
disable.public String buildNavigationState(String viewName, Map<String,Object> parameters)
viewName and appending any parameter in serialized
formviewName - View nameparameters - View parameterspublic ViewConfiguration getViewConfiguration(Class<? extends com.vaadin.navigator.View> viewClass)
public Optional<ViewConfiguration> getViewConfiguration(String navigationState)
ViewConfiguration which corresponds to the View represented by the given
navigationState, if available.navigationState - Navigation stateViewConfigurationCopyright © 2019 The Holon Platform. All rights reserved.