示例#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);
    }
  }
示例#2
0
 @Override
 public void onStop() {
   clearHandlers();
   if (fsiActivity != null) {
     fsiActivity.onStop();
   }
   if (jsActivity != null) {
     jsActivity.onStop();
   }
 }
示例#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);
    }
  }