@Override public void onFlashStatusChange(FlashStatusChangeEvent event) { if (event.status() == useFlash) { return; } useFlash = event.status(); if (useFlash) { fsiActivity = new FSIViewerActivity( new BookViewerPlace( initialPlace.getType(), initialPlace.getBook(), jsActivity.getCurrentPage()), clientFactory); jsActivity.onStop(); jsActivity = null; fsiActivity.start(container, eventBus); } else { jsActivity = new JSViewerActivity( new BookViewerPlace( initialPlace.getType(), initialPlace.getBook(), fsiActivity.getCurrentPage()), clientFactory); fsiActivity.onStop(); fsiActivity = null; jsActivity.start(container, eventBus); } }
@Override public void onStop() { clearHandlers(); if (fsiActivity != null) { fsiActivity.onStop(); } if (jsActivity != null) { jsActivity.onStop(); } }
@Override public void start(AcceptsOneWidget panel, EventBus eventBus) { this.container = panel; this.eventBus = eventBus; handlers.add(eventBus.addHandler(FlashStatusChangeEvent.TYPE, this)); if (useFlash) { fsiActivity.start(panel, eventBus); } else { jsActivity.start(panel, eventBus); } }