com.vaadin.addon.touchkit.gwt.client.offlinemode
Interface OfflineMode

All Known Implementing Classes:
DefaultOfflineMode

public interface OfflineMode

Applications that need to have an advanced offline mode use this interface to connect to TouchKit. By default the framework uses an instance of DefaultOfflineMode that simply displays a sad face and a message why the online app cannot be used.

Add a GWT deferred binding rule in your widgetset to replace this with your own implementation. An example:

        
                
        
 


Nested Class Summary
static interface OfflineMode.ActivationEvent
          Holds the reason for why the offline mode was activated.
static class OfflineMode.ActivationReason
           
 
Method Summary
 void activate(OfflineMode.ActivationEvent event)
          This method is called when a TouchKit app decides to go offline.
 boolean deactivate()
          This method is called when TouchKit detects that it might be possible to go online again (e.g.
 boolean isActive()
           
 

Method Detail

activate

void activate(OfflineMode.ActivationEvent event)
This method is called when a TouchKit app decides to go offline. This most commonly happens if there is no network connection available. Offline mode can also be activated e.g. due to an inaccessible server, bad responses or as the result of a request by the server side application.

Parameters:
event - Details about the activation.

deactivate

boolean deactivate()
This method is called when TouchKit detects that it might be possible to go online again (e.g. the network connection has returned). The implementation should e.g. remove or hide offline related elements from the document.

If you have implemented a more advanced offline mode, override this method and gracefully return to normal operation. In that case return false

Returns:
true if offline mode was shut down, false if offline mode was not shut down

isActive

boolean isActive()
Returns:
true if offline mode is currently active


Copyright © 2014 Vaadin Ltd. All rights reserved.