public abstract class AbstractNavigatorBuilder<B extends ViewNavigator.NavigatorBuilder<B>,C extends com.vaadin.navigator.Navigator & ViewNavigatorAdapter> extends Object implements ViewNavigator.NavigatorBuilder<B>
ViewNavigator.NavigatorBuilder class.| Constructor and Description |
|---|
AbstractNavigatorBuilder(C navigator) |
| Modifier and Type | Method and Description |
|---|---|
B |
addProvider(com.vaadin.navigator.ViewProvider provider)
Add a
ViewProvider to navigator. |
B |
authenticationEnabled(boolean authenticationEnabled)
Set whether the support for
Authenticate annotation on Views or UI is enabled. |
B |
defaultViewName(String defaultViewName)
Set the default view name.
|
B |
defaultViewNavigationStrategy(DefaultViewNavigationStrategy defaultViewNavigationStrategy)
Set the strategy to use to navigate to the default view.
|
B |
defaultViewWindowConfigurator(Consumer<ViewWindowConfigurator> configurator)
Set the default
ViewWindowConfigurator consumer to used for all the view Windows created by this
navigator. |
B |
errorView(com.vaadin.navigator.View errorView)
Set the view to be displayed when no other view matches the navigation state.
|
B |
errorViewProvider(com.vaadin.navigator.ViewProvider errorViewProvider)
Registers a view provider that is queried for a view when no other view matches the navigation state.
|
B |
maxNavigationHistorySize(int maxSize)
Set navigation history max size
|
B |
navigateToDefaultViewWhenViewNotAvailable(boolean navigateToDefaultViewWhenViewNotAvailable)
Set whether to navigate to default view (if setted) when a view is not available from current navigation
state
|
B |
viewClassProvider(com.vaadin.navigator.ViewProvider provider,
ViewClassProvider viewClassProvider)
Associate given
ViewClassProvider to given ViewProvider. |
B |
withViewChangeListener(com.vaadin.navigator.ViewChangeListener viewChangeListener)
Add a
ViewChangeListener to Navigator |
public AbstractNavigatorBuilder(C navigator)
public B maxNavigationHistorySize(int maxSize)
ViewNavigator.NavigatorBuildermaxNavigationHistorySize in interface ViewNavigator.NavigatorBuilder<B extends ViewNavigator.NavigatorBuilder<B>>maxSize - Max size of retained navigation statespublic B addProvider(com.vaadin.navigator.ViewProvider provider)
ViewNavigator.NavigatorBuilderViewProvider to navigator. Providers are called in order of registration until one that can
handle the requested view name is found.addProvider in interface ViewNavigator.NavigatorBuilder<B extends ViewNavigator.NavigatorBuilder<B>>provider - View provider to add (not null)public B viewClassProvider(com.vaadin.navigator.ViewProvider provider, ViewClassProvider viewClassProvider)
ViewNavigator.NavigatorBuilderViewClassProvider to given ViewProvider.viewClassProvider in interface ViewNavigator.NavigatorBuilder<B extends ViewNavigator.NavigatorBuilder<B>>provider - View provider (not null)viewClassProvider - View class provider bound to the given View providerpublic B defaultViewName(String defaultViewName)
ViewNavigator.NavigatorBuilderView 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 in interface ViewNavigator.NavigatorBuilder<B extends ViewNavigator.NavigatorBuilder<B>>defaultViewName - the default view name to setpublic B defaultViewNavigationStrategy(DefaultViewNavigationStrategy defaultViewNavigationStrategy)
ViewNavigator.NavigatorBuilderViewNavigator.NavigatorBuilder.defaultViewName(String) is ignored.defaultViewNavigationStrategy in interface ViewNavigator.NavigatorBuilder<B extends ViewNavigator.NavigatorBuilder<B>>defaultViewNavigationStrategy - The strategy to setpublic B navigateToDefaultViewWhenViewNotAvailable(boolean navigateToDefaultViewWhenViewNotAvailable)
ViewNavigator.NavigatorBuildernavigateToDefaultViewWhenViewNotAvailable in interface ViewNavigator.NavigatorBuilder<B extends ViewNavigator.NavigatorBuilder<B>>navigateToDefaultViewWhenViewNotAvailable - true to navigate to default view (if setted)
when a view is not available from current navigation statepublic B defaultViewWindowConfigurator(Consumer<ViewWindowConfigurator> configurator)
ViewNavigator.NavigatorBuilderViewWindowConfigurator consumer to used for all the view Windows created by this
navigator.defaultViewWindowConfigurator in interface ViewNavigator.NavigatorBuilder<B extends ViewNavigator.NavigatorBuilder<B>>configurator - View window configuratorpublic B errorView(com.vaadin.navigator.View errorView)
ViewNavigator.NavigatorBuildererrorView in interface ViewNavigator.NavigatorBuilder<B extends ViewNavigator.NavigatorBuilder<B>>errorView - Error viewpublic B errorViewProvider(com.vaadin.navigator.ViewProvider errorViewProvider)
ViewNavigator.NavigatorBuildergetViewName(String navigationState) should return navigationState.errorViewProvider in interface ViewNavigator.NavigatorBuilder<B extends ViewNavigator.NavigatorBuilder<B>>errorViewProvider - Error view providerpublic B withViewChangeListener(com.vaadin.navigator.ViewChangeListener viewChangeListener)
ViewNavigator.NavigatorBuilderViewChangeListener to NavigatorwithViewChangeListener in interface ViewNavigator.NavigatorBuilder<B extends ViewNavigator.NavigatorBuilder<B>>viewChangeListener - ViewChangeListener to addpublic B authenticationEnabled(boolean authenticationEnabled)
ViewNavigator.NavigatorBuilderAuthenticate 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
Authenticate.redirectURI() attribute if a URI scheme is not specified.
The authentication support is enabled by default.
authenticationEnabled in interface ViewNavigator.NavigatorBuilder<B extends ViewNavigator.NavigatorBuilder<B>>authenticationEnabled - true to enable the Authenticate support, false
to disable.Copyright © 2019 The Holon Platform. All rights reserved.