示例#1
0
 @Override
 public void onTableSelectionChanged(TableSelectionChangeEvent event) {
   if (event.hasTable()) {
     updateDisplay(event.getTable());
   } else {
     updateDisplay(event.getDatasourceName(), event.getTableName());
   }
 }
示例#2
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();
          }
        });
  }