com.vaadin.spring.navigator
Class SpringNavigator

java.lang.Object
  extended by com.vaadin.navigator.Navigator
      extended by com.vaadin.spring.navigator.SpringNavigator
All Implemented Interfaces:
Serializable

@UIScope
public class SpringNavigator
extends com.vaadin.navigator.Navigator

A Navigator that automatically uses SpringViewProvider and allows late initialization.

Author:
Vaadin Ltd
See Also:
Serialized Form

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.SingleComponentContainerViewDisplay, com.vaadin.navigator.Navigator.StaticViewProvider, com.vaadin.navigator.Navigator.UriFragmentManager
 
Constructor Summary
SpringNavigator()
           
SpringNavigator(com.vaadin.ui.UI ui, com.vaadin.ui.ComponentContainer container)
           
SpringNavigator(com.vaadin.ui.UI ui, com.vaadin.navigator.NavigationStateManager stateManager, com.vaadin.navigator.ViewDisplay display)
           
SpringNavigator(com.vaadin.ui.UI ui, com.vaadin.ui.SingleComponentContainer container)
           
SpringNavigator(com.vaadin.ui.UI ui, com.vaadin.navigator.ViewDisplay display)
           
 
Method Summary
 void addViewActivationListener(ViewActivationListener listener)
          Adds a listener on view activation
protected  org.springframework.context.ApplicationContext getWebApplicationContext()
           
 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)
           The SpringViewProvider bean from the context is automatically registered for the navigator.
 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.
 void removeViewActivationListener(ViewActivationListener listener)
          Removes a listener on view activation
 void setErrorView(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  void switchView(com.vaadin.navigator.ViewChangeListener.ViewChangeEvent event)
           
 
Methods inherited from class com.vaadin.navigator.Navigator
addProvider, addView, addView, addViewChangeListener, beforeViewChange, destroy, fireAfterViewChange, fireBeforeViewChange, getCurrentView, getDisplay, getState, getStateManager, getUI, navigateTo, navigateTo, removeProvider, removeView, removeViewChangeListener, revertNavigation, setErrorProvider, setErrorView, updateNavigationState
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

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.navigator.NavigationStateManager stateManager,
                       com.vaadin.navigator.ViewDisplay display)

SpringNavigator

public SpringNavigator(com.vaadin.ui.UI ui,
                       com.vaadin.ui.SingleComponentContainer container)

SpringNavigator

public SpringNavigator(com.vaadin.ui.UI ui,
                       com.vaadin.navigator.ViewDisplay display)
Method Detail

addViewActivationListener

public void addViewActivationListener(ViewActivationListener listener)
Adds a listener on view activation

Parameters:
listener -

removeViewActivationListener

public void removeViewActivationListener(ViewActivationListener listener)
Removes a listener on view activation

Parameters:
listener -

switchView

protected void switchView(com.vaadin.navigator.ViewChangeListener.ViewChangeEvent event)
Overrides:
switchView in class com.vaadin.navigator.Navigator

init

public void init(com.vaadin.ui.UI ui,
                 com.vaadin.ui.ComponentContainer container)
Initializes an injected navigator and registers SpringViewProvider 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.

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 registers SpringViewProvider 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.

Parameters:
ui - The UI to which this Navigator is attached.
container - The single component container used to display the views handled by this navigator

init

public void init(com.vaadin.ui.UI ui,
                 com.vaadin.navigator.ViewDisplay display)
Initializes an injected navigator and registers SpringViewProvider 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.

Parameters:
ui - The UI to which this Navigator is attached.
display - The ViewDisplay used to display the views handled by this navigator

init

public void init(com.vaadin.ui.UI ui,
                 com.vaadin.navigator.NavigationStateManager stateManager,
                 com.vaadin.navigator.ViewDisplay display)
The SpringViewProvider bean from the context is automatically registered for the navigator.

Overrides:
init in class com.vaadin.navigator.Navigator

setErrorView

public void setErrorView(Class<? extends com.vaadin.navigator.View> viewClass)
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 previous Navigator.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:
setErrorView in class com.vaadin.navigator.Navigator
Parameters:
viewClass - The View class whose instance should be used as the error view.

getWebApplicationContext

protected org.springframework.context.ApplicationContext getWebApplicationContext()


Copyright © 2016 Vaadin Ltd. All Rights Reserved.