Search in sources :

Example 1 with AppCache

use of com.bedatadriven.rebar.appcache.client.AppCache in project activityinfo by bedatadriven.

the class AppCacheMonitor method start.

public static void start() {
    AppCache appCache = AppCacheFactory.get();
    appCache.addUpdateReadyHandler(new UpdateReadyEventHandler() {

        @Override
        public void onAppCacheUpdateReady() {
            MessageBox.confirm(I18N.MESSAGES.newVersion(ClientContext.getAppTitle()), I18N.CONSTANTS.newVersionChoice(), new Listener<MessageBoxEvent>() {

                @Override
                public void handleEvent(MessageBoxEvent be) {
                    if (be.getButtonClicked().getItemId().equals(Dialog.YES)) {
                        Window.Location.reload();
                    }
                }
            });
        }
    });
}
Also used : MessageBoxEvent(com.extjs.gxt.ui.client.event.MessageBoxEvent) AppCache(com.bedatadriven.rebar.appcache.client.AppCache) Listener(com.extjs.gxt.ui.client.event.Listener) UpdateReadyEventHandler(com.bedatadriven.rebar.appcache.client.events.UpdateReadyEventHandler)

Aggregations

AppCache (com.bedatadriven.rebar.appcache.client.AppCache)1 UpdateReadyEventHandler (com.bedatadriven.rebar.appcache.client.events.UpdateReadyEventHandler)1 Listener (com.extjs.gxt.ui.client.event.Listener)1 MessageBoxEvent (com.extjs.gxt.ui.client.event.MessageBoxEvent)1