@UIScope public class DefaultSpringViewNavigator extends com.vaadin.spring.navigator.SpringNavigator implements ViewNavigatorAdapter, SpringViewNavigator
SpringViewNavigator implementation.| Modifier and Type | Class and Description |
|---|---|
static class |
DefaultSpringViewNavigator.SpringViewNavigatorBuilder
Builder to create
SpringViewNavigator instances. |
com.vaadin.navigator.Navigator.ClassBasedViewProvider, com.vaadin.navigator.Navigator.ComponentContainerViewDisplay, com.vaadin.navigator.Navigator.EmptyView, com.vaadin.navigator.Navigator.PushStateManager, com.vaadin.navigator.Navigator.SingleComponentContainerViewDisplay, com.vaadin.navigator.Navigator.StaticViewProvider, com.vaadin.navigator.Navigator.UriFragmentManagerSpringViewNavigator.BuilderViewNavigator.NavigationBuilder, ViewNavigator.NavigatorBuilder<B extends ViewNavigator.NavigatorBuilder<B>>, ViewNavigator.ViewNavigationException, ViewNavigator.ViewNavigatorChangeEventCONTEXT_KEY, VIEW_URI_SCHEME| Constructor and Description |
|---|
DefaultSpringViewNavigator()
Default construtor.
|
DefaultSpringViewNavigator(com.vaadin.ui.UI ui,
com.vaadin.navigator.NavigationStateManager stateManager,
com.vaadin.navigator.ViewDisplay display)
Creates a navigator.
|
| Modifier and Type | Method and Description |
|---|---|
void |
addProvider(com.vaadin.navigator.ViewProvider provider) |
NavigatorActuator<?> |
getActuator()
Get the NavigatorActuator associated to this adapter
|
String |
getCurrentViewName()
Get current (active) view name in navigator
|
String |
getDefaultViewName()
Get default view name
|
ViewConfiguration |
getViewConfiguration(Class<? extends com.vaadin.navigator.View> viewClass)
Get
ViewConfiguration associated to given view class |
void |
init(com.vaadin.ui.UI ui,
com.vaadin.ui.ComponentContainer container)
Initializes an injected navigator and registers
SpringViewProvider for it. |
void |
init(com.vaadin.ui.UI ui,
com.vaadin.navigator.NavigationStateManager stateManager,
com.vaadin.navigator.ViewDisplay display)
Initializes an injected navigator and registers
SpringViewProvider for it, using a custom
NavigationStateManager. |
void |
init(com.vaadin.ui.UI ui,
com.vaadin.ui.SingleComponentContainer container)
Initializes an injected navigator and registers
SpringViewProvider for it. |
void |
init(com.vaadin.ui.UI ui,
com.vaadin.navigator.ViewDisplay display)
Initializes an injected navigator and registers
SpringViewProvider for it. |
boolean |
navigateBack()
Navigates back to previous
View, if any. |
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
ViewNavigator.navigateTo(String, Map) but rendering the View contents in an application Window, using optional
windowConfiguration to setup Window features. |
void |
navigateTo(String navigationState)
Navigates to the
View identified by given viewName. |
void |
navigateTo(String viewName,
Map<String,Object> parameters)
Navigates to the
View identified by given viewName using given parameters, if
any, and linking them to View fields using ViewParameter annotated view class fields. |
void |
navigateToDefault()
Navigates to the default View
|
void |
navigateToState(String navigationState)
Navigates to a view and initialize the view with given parameters.
|
void |
navigateToView(com.vaadin.navigator.View view,
String viewName,
String parameters)
Navigate to given View
|
void |
removeProvider(com.vaadin.navigator.ViewProvider provider) |
void |
setAccessDeniedViewClass(Class<? extends com.vaadin.navigator.View> accessDeniedViewClass)
Deferred access denied view class configuration
|
void |
setDefaultViewName(String defaultViewName)
Set the default view name.
|
void |
setErrorProvider(com.vaadin.navigator.ViewProvider provider) |
void |
setErrorViewClass(Class<? extends com.vaadin.navigator.View> errorViewClass)
Deferred error view class configuration
|
void |
setup(com.vaadin.ui.UI ui,
com.vaadin.navigator.NavigationStateManager stateManager,
com.vaadin.navigator.ViewDisplay display)
Init navigator.
|
void |
setViewClassProvider(com.vaadin.navigator.ViewProvider provider,
ViewClassProvider viewClassProvider)
Set the
ViewClassProvider bound to given ViewProvider. |
void |
updateCurrentNavigationState(com.vaadin.navigator.ViewChangeListener.ViewChangeEvent event)
Update current navigation state relying in given View change event
|
addViewActivationListener, removeViewActivationListener, setErrorViewaddView, addView, addViewChangeListener, destroy, getCurrentNavigationState, getCurrentView, getDisplay, getState, getStateParameterMap, getStateParameterMap, getUI, removeView, removeViewChangeListener, runAfterLeaveConfirmation, setErrorViewequals, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitbuilderaddViewChangeListener, getCurrent, getCurrentView, navigateInWindow, navigateInWindow, navigateInWindow, require, runAfterLeaveConfirmation, toViewpublic DefaultSpringViewNavigator(com.vaadin.ui.UI ui,
com.vaadin.navigator.NavigationStateManager stateManager,
com.vaadin.navigator.ViewDisplay display)
When a custom navigation state manager is not needed, use one of the other constructors which use a URI fragment based state manager.
ui - The UI to which this Navigator is attached.stateManager - The NavigationStateManager keeping track of the active view and enabling bookmarking and
direct navigation or null to use the default implementationdisplay - The ViewDisplay used to display the views handled by this navigatorpublic DefaultSpringViewNavigator()
With this constructor, init(UI, NavigationStateManager, ViewDisplay) method is not called, since
navigator initialization is delegated to subclasses.
public NavigatorActuator<?> getActuator()
ViewNavigatorAdaptergetActuator in interface ViewNavigatorAdapterpublic void setErrorProvider(com.vaadin.navigator.ViewProvider provider)
setErrorProvider in class com.vaadin.navigator.Navigatorpublic void setErrorViewClass(Class<? extends com.vaadin.navigator.View> errorViewClass)
errorViewClass - View class to use as error viewpublic void setAccessDeniedViewClass(Class<? extends com.vaadin.navigator.View> accessDeniedViewClass)
accessDeniedViewClass - View class to use as access denied viewpublic void init(com.vaadin.ui.UI ui,
com.vaadin.ui.ComponentContainer container)
SpringViewNavigatorSpringViewProvider for it.
The default navigation state manager (based on URI fragments) is used.
Navigation is automatically initiated after UI.init() if a navigator was created. If at a later point
changes are made to the navigator, navigator.navigateTo(navigator.getState()) may need to be explicitly
called to ensure the current view matches the navigation state.
init in interface SpringViewNavigatorinit in class com.vaadin.spring.navigator.SpringNavigatorui - The UI to which this Navigator is attachedcontainer - The component container used to display the views handled by this navigatorpublic void init(com.vaadin.ui.UI ui,
com.vaadin.ui.SingleComponentContainer container)
SpringViewNavigatorSpringViewProvider for it.
The default navigation state manager (based on URI fragments) is used.
Navigation is automatically initiated after UI.init() if a navigator was created. If at a later point
changes are made to the navigator, navigator.navigateTo(navigator.getState()) may need to be explicitly
called to ensure the current view matches the navigation state.
init in interface SpringViewNavigatorinit in class com.vaadin.spring.navigator.SpringNavigatorui - The UI to which this Navigator is attachedcontainer - The single component container used to display the views handled by this navigatorpublic void init(com.vaadin.ui.UI ui,
com.vaadin.navigator.ViewDisplay display)
SpringViewNavigatorSpringViewProvider for it.
The default navigation state manager (based on URI fragments) is used.
Navigation is automatically initiated after UI.init() if a navigator was created. If at a later point
changes are made to the navigator, navigator.navigateTo(navigator.getState()) may need to be explicitly
called to ensure the current view matches the navigation state.
init in interface SpringViewNavigatorinit in class com.vaadin.spring.navigator.SpringNavigatorui - The UI to which this Navigator is attacheddisplay - The ViewDisplay used to display the views handled by this navigatorpublic void init(com.vaadin.ui.UI ui,
com.vaadin.navigator.NavigationStateManager stateManager,
com.vaadin.navigator.ViewDisplay display)
SpringViewNavigatorSpringViewProvider for it, using a custom
NavigationStateManager.
Navigation is automatically initiated after UI.init() if a navigator was created. If at a later point
changes are made to the navigator, navigator.navigateTo(navigator.getState()) may need to be explicitly
called to ensure the current view matches the navigation state.
init in interface SpringViewNavigatorinit in class com.vaadin.spring.navigator.SpringNavigatorui - The UI to which this Navigator is attachedstateManager - The NavigationStateManager keeping track of the active view and enabling bookmarking and
direct navigation or null for defaultdisplay - The ViewDisplay used to display the views handled by this navigatorpublic void setup(com.vaadin.ui.UI ui,
com.vaadin.navigator.NavigationStateManager stateManager,
com.vaadin.navigator.ViewDisplay display)
ViewNavigatorAdaptersetup in interface ViewNavigatorAdapterui - UIstateManager - NavigationStateManagerdisplay - View displaypublic void updateCurrentNavigationState(com.vaadin.navigator.ViewChangeListener.ViewChangeEvent event)
ViewNavigatorAdapterupdateCurrentNavigationState in interface ViewNavigatorAdapterevent - View change eventpublic void navigateToState(String navigationState)
ViewNavigator
The navigationState string consists of a view name optionally followed by a slash and a parameters
part that is passed as-is to the view. ViewProviders are used to find and create the correct type of view.
If multiple providers return a matching view, the view with the longest name is selected. This way, e.g. hierarchies of subviews can be registered like "admin/", "admin/users", "admin/settings" and the longest match is used.
If the view being deactivated indicates it wants a confirmation for the navigation operation, the user is asked for the confirmation.
Registered ViewChangeListeners are called upon successful view change.
navigateToState in interface ViewNavigatornavigationState - View name and parameterspublic void navigateToView(com.vaadin.navigator.View view,
String viewName,
String parameters)
ViewNavigatorAdapternavigateToView in interface ViewNavigatorAdapterview - View instanceviewName - View nameparameters - View parameterspublic void addProvider(com.vaadin.navigator.ViewProvider provider)
addProvider in class com.vaadin.navigator.Navigatorpublic void removeProvider(com.vaadin.navigator.ViewProvider provider)
removeProvider in class com.vaadin.navigator.Navigatorpublic void setViewClassProvider(com.vaadin.navigator.ViewProvider provider,
ViewClassProvider viewClassProvider)
ViewNavigatorAdapterViewClassProvider bound to given ViewProvider.setViewClassProvider in interface ViewNavigatorAdapterprovider - View provider (not null)viewClassProvider - View class providerpublic void navigateTo(String navigationState)
ViewNavigatorView identified by given viewName.
If the view being deactivated indicates it wants a confirmation for the navigation operation, the user is asked for the confirmation.
Registered ViewChangeListeners are called upon successful view change.
navigateTo in interface ViewNavigatornavigateTo in class com.vaadin.navigator.NavigatornavigationState - View namepublic void navigateTo(String viewName, Map<String,Object> parameters) throws ViewNavigator.ViewNavigationException
ViewNavigatorView identified by given viewName using given parameters, if
any, and linking them to View fields using ViewParameter annotated view class fields.
If the view being deactivated indicates it wants a confirmation for the navigation operation, the user is asked for the confirmation.
Registered ViewChangeListeners are called upon successful view change.
navigateTo in interface ViewNavigatorviewName - View nameparameters - Optional view parametersViewNavigator.ViewNavigationException - View with given name cannot be found or other view handling errorpublic com.vaadin.ui.Window navigateInWindow(String viewName, Consumer<ViewWindowConfigurator> windowConfiguration, Map<String,Object> parameters) throws ViewNavigator.ViewNavigationException
ViewNavigatorView identified by given viewName using the same behaviour of
ViewNavigator.navigateTo(String, Map) but rendering the View contents in an application Window, using optional
windowConfiguration to setup Window features.navigateInWindow in interface ViewNavigatorviewName - View namewindowConfiguration - View window configurator to setup the view Windowparameters - Optional view parametersViewNavigator.ViewNavigationException - View with given name cannot be found or other view handling errorpublic boolean navigateBack()
throws ViewNavigator.ViewNavigationException
ViewNavigatorView, if any. In no previous View is available and a default view is defined,
navigator will navigate to the default view.navigateBack in interface ViewNavigatortrue if a previous view in navigation history, or the default view, was available and back
navigation succeededViewNavigator.ViewNavigationException - View handling errorpublic void navigateToDefault()
throws ViewNavigator.ViewNavigationException
ViewNavigatornavigateToDefault in interface ViewNavigatorViewNavigator.ViewNavigationException - If no default View is available or other view handling errorpublic String getDefaultViewName()
ViewNavigatorgetDefaultViewName in interface ViewNavigatornull if not definedpublic 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()
ViewNavigatorgetCurrentViewName in interface ViewNavigatornull if no view is currently active in navigatorpublic ViewConfiguration getViewConfiguration(Class<? extends com.vaadin.navigator.View> viewClass)
ViewConfiguration.ViewConfigurationProviderViewConfiguration associated to given view class
This method is intended for internal use only.
getViewConfiguration in interface ViewConfiguration.ViewConfigurationProviderviewClass - View classnull if not availableCopyright © 2019 The Holon Platform. All rights reserved.