com.vaadin.navigator
Interface ViewChangeListener

All Superinterfaces:
Serializable

public interface ViewChangeListener
extends Serializable

Interface for listening to View changes before and after they occur. Implementations of this interface can also block navigation between views before it is performed.

Since:
7.0
Author:
Vaadin Ltd

Nested Class Summary
static class ViewChangeListener.ViewChangeEvent
          Event received by the listener for attempted and executed view changes.
 
Method Summary
 boolean isViewChangeAllowed(ViewChangeListener.ViewChangeEvent event)
          Check whether changing the view is permissible.
 void navigatorViewChanged(ViewChangeListener.ViewChangeEvent event)
          Invoked after the view has changed.
 

Method Detail

isViewChangeAllowed

boolean isViewChangeAllowed(ViewChangeListener.ViewChangeEvent event)
Check whether changing the view is permissible. This method may also e.g. open a "save" dialog or question about the change, which may re-initiate the navigation operation after user action. If this listener does not want to block the view change (e.g. does not know the view in question), it should return true. If any listener returns false, the view change is not allowed.

Parameters:
event - view change event
Returns:
true if the view change should be allowed or this listener does not care about the view change, false to block the change

navigatorViewChanged

void navigatorViewChanged(ViewChangeListener.ViewChangeEvent event)
Invoked after the view has changed. Be careful for deadlocks if you decide to change the view again in the listener.

Parameters:
event - view change event


Copyright © 2000-2011 Vaadin Ltd. All Rights Reserved.