Exemplo n.º 1
0
  @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);
    }
  }
Exemplo n.º 2
0
 @Override
 public void onStop() {
   clearHandlers();
   if (fsiActivity != null) {
     fsiActivity.onStop();
   }
   if (jsActivity != null) {
     jsActivity.onStop();
   }
 }
Exemplo n.º 3
0
  @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);
    }
  }