Class SpringNavigator
- All Implemented Interfaces:
Serializable
SpringViewProvider and allows
late initialization.- Author:
- Vaadin Ltd
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from class com.vaadin.navigator.Navigator
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.UriFragmentManager -
Field Summary
Fields inherited from class com.vaadin.navigator.Navigator
display, stateManager, ui -
Constructor Summary
ConstructorsConstructorDescriptionSpringNavigator(com.vaadin.ui.UI ui, com.vaadin.navigator.NavigationStateManager stateManager, com.vaadin.navigator.ViewDisplay display) SpringNavigator(com.vaadin.ui.UI ui, com.vaadin.navigator.ViewDisplay display) SpringNavigator(com.vaadin.ui.UI ui, com.vaadin.ui.ComponentContainer container) SpringNavigator(com.vaadin.ui.UI ui, com.vaadin.ui.SingleComponentContainer container) -
Method Summary
Modifier and TypeMethodDescriptionvoidAdds a listener on view activationprotected org.springframework.context.ApplicationContextvoidinit(com.vaadin.ui.UI ui, com.vaadin.navigator.NavigationStateManager stateManager, com.vaadin.navigator.ViewDisplay display) TheSpringViewProviderbean from the context is automatically registered for the navigator.voidinit(com.vaadin.ui.UI ui, com.vaadin.navigator.ViewDisplay display) Initializes an injected navigator and registersSpringViewProviderfor it.voidinit(com.vaadin.ui.UI ui, com.vaadin.ui.ComponentContainer container) Initializes an injected navigator and registersSpringViewProviderfor it.voidinit(com.vaadin.ui.UI ui, com.vaadin.ui.SingleComponentContainer container) Initializes an injected navigator and registersSpringViewProviderfor it.voidRemoves a listener on view activationvoidsetErrorView(Class<? extends com.vaadin.navigator.View> viewClass) Registers a view class for the view to show when no other view matches the navigation state.protected voidswitchView(com.vaadin.navigator.ViewChangeListener.ViewChangeEvent event) Methods inherited from class com.vaadin.navigator.Navigator
addProvider, addView, addView, addViewChangeListener, beforeViewChange, createNavigationStateManager, destroy, fireAfterViewChange, fireBeforeViewChange, getCurrentNavigationState, getCurrentView, getDisplay, getState, getStateManager, getStateParameterMap, getStateParameterMap, getUI, getViewProvider, navigateTo, navigateTo, parseParameterStringToMap, parseStateParameterMap, performNavigateTo, removeProvider, removeView, removeViewChangeListener, revertNavigation, runAfterLeaveConfirmation, setErrorProvider, setErrorView, updateNavigationState
-
Constructor Details
-
SpringNavigator
public SpringNavigator() -
SpringNavigator
public SpringNavigator(com.vaadin.ui.UI ui, com.vaadin.ui.ComponentContainer container) -
SpringNavigator
public SpringNavigator(com.vaadin.ui.UI ui, com.vaadin.ui.SingleComponentContainer container)
-
-
Method Details
-
init
public void init(com.vaadin.ui.UI ui, com.vaadin.ui.ComponentContainer container) Initializes an injected navigator and registersSpringViewProviderfor 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.- Parameters:
ui- The UI to which this Navigator is attached.container- The component container used to display the views handled by this navigator
-
init
public void init(com.vaadin.ui.UI ui, com.vaadin.ui.SingleComponentContainer container) Initializes an injected navigator and registersSpringViewProviderfor 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.- Parameters:
ui- The UI to which this Navigator is attached.container- The single component container used to display the views handled by this navigator
-
setErrorView
Registers a view class for the view to show when no other view matches the navigation state. This implicitly sets an appropriate error view provider and overrides any previousNavigator.setErrorProvider(ViewProvider)call.A bean of the given type is fetched on demand from the application context to be used as the error view. As a fallback mechanism for backwards compatibility,
Class.newInstance()is used if no such bean is found.Note that an error view bean must be UI or prototype scoped.
- Overrides:
setErrorViewin classcom.vaadin.navigator.Navigator- Parameters:
viewClass- The View class whose instance should be used as the error view.
-
getWebApplicationContext
protected org.springframework.context.ApplicationContext getWebApplicationContext()