Exemplo n.º 1
0
  @Override
  public void start(AcceptsOneWidget panel, EventBus eventBus) {
    this.eventBus = eventBus;

    display.setPresenter(this);
    panel.setWidget(display);
    this.eventBus = eventBus;
    handlerRegistration(eventBus);
    if (repositoryUri == null || repositoryUri.length() == 0 || repositoryUri.equals("null")) {
      this.repo = JavaScriptObject.createObject().<Repository>cast();
      display.setData(this.repo);
    } else {
      display.setData(this.repo);
      getRepo(this.repositoryUri);
      fetchFiles(repositoryUri, this.prefix);
      CacheManager.EventConstructor change =
          new CacheManager.EventConstructor() {
            @Override
            public RepoUpdate newInstance(String key) {
              return new RepoUpdate();
            }
          };
      cacheManager.register(repositoryUri, "repoContent", change);
    }
  }
Exemplo n.º 2
0
 @Override
 public void onStop() {
   this.display.setData(null);
   cacheManager.unregister(repositoryUri, "repoContent");
 }