Esempio n. 1
0
  private void addEventHandlers() {
    addRegisteredHandler(TableSelectionChangeEvent.getType(), this);
    addRegisteredHandler(ConfirmationEvent.getType(), new RemoveConfirmationEventHandler());

    addRegisteredHandler(
        VariableRefreshEvent.getType(),
        new VariableRefreshEvent.Handler() {
          @Override
          public void onVariableRefresh(VariableRefreshEvent event) {
            if (table != null) {
              updateVariables();
            }
          }
        });

    registerHandler(getView().addVariableSortHandler(new VariableSortHandler()));

    addRegisteredHandler(
        TableIndexStatusRefreshEvent.getType(), new TableIndexStatusRefreshHandler());

    // Delete variables confirmation handler
    addRegisteredHandler(ConfirmationEvent.getType(), new DeleteVariableConfirmationEventHandler());

    addRegisteredHandler(
        ValuesQueryEvent.getType(),
        new ValuesQueryEvent.ValuesQueryHandler() {
          @Override
          public void onValuesQuery(ValuesQueryEvent event) {
            valuesFilter = event.getQuery();
            valuesFilterText = event.getText();
          }
        });
  }
Esempio n. 2
0
  @Override
  protected void onReveal() {
    handlerRegistration =
        getEventBus()
            .addHandler(SummaryRequiredEvent.getType(), new DeferredSummaryRequestHandler());
    registerHandler(handlerRegistration);

    addRegisteredHandler(
        VariableRefreshEvent.getType(),
        new VariableRefreshEvent.Handler() {
          @Override
          public void onVariableRefresh(VariableRefreshEvent event) {
            requestSummary();
          }
        });
  }
Esempio n. 3
0
  @Override
  protected void onBind() {
    super.onBind();
    setInSlot(Display.Slots.Values, valuesTablePresenter);
    setInSlot(Display.Slots.ScriptEditor, scriptEditorPresenter);
    setInSlot(Display.Slots.History, variableVcsCommitHistoryPresenter);
    setInSlot(Display.Slots.Summary, summaryTabPresenter);

    addRegisteredHandler(VariableSelectionChangeEvent.getType(), this);
    addRegisteredHandler(
        VariableRefreshEvent.getType(),
        new VariableRefreshEvent.Handler() {
          @Override
          public void onVariableRefresh(VariableRefreshEvent event) {
            if (variableUpdatePending || variable == null) return;
            ResourceRequestBuilderFactory.<VariableDto>newBuilder() //
                .forResource(variable.getLink()) //
                .withCallback(
                    new ResourceCallback<VariableDto>() {
                      @Override
                      public void onResource(Response response, VariableDto resource) {
                        updateVariableDisplay(resource);
                        updateDerivedVariableDisplay();
                        variableUpdatePending = false;
                      }
                    }) //
                .get()
                .send();
          }
        });
    addRegisteredHandler(ConfirmationEvent.getType(), new RemoveConfirmationEventHandler());

    addRegisteredHandler(
        VcsCommitInfoReceivedEvent.getType(),
        new VcsCommitInfoReceivedEvent.Handler() {
          @Override
          public void onVcsCommitInfoReceived(VcsCommitInfoReceivedEvent event) {
            getView().goToEditScript();
            scriptEditorPresenter.setScript(event.getCommitInfoDto().getBlob());
          }
        });
  }