示例#1
1
  @Override
  public void filterTable(String filter) {

    // store list only for first time
    if (fullBackup.isEmpty() || fullBackup == null) {
      fullBackup.addAll(getList());
    }

    // always clear selected items
    selectionModel.clear();
    list.clear();

    if (filter.equalsIgnoreCase("")) {
      list.addAll(fullBackup);
    } else {
      for (ExtSource src : fullBackup) {
        // store ext source if name or type matches
        if ((src.getName().toLowerCase().startsWith(filter.toLowerCase()))
            || renameContent(src.getType()).toLowerCase().startsWith(filter.toLowerCase())) {
          list.add(src);
        }
      }
    }

    if (list.isEmpty() && !filter.isEmpty()) {
      loaderImage.setEmptyResultMessage("No external source matching '" + filter + "' found.");
    } else {
      loaderImage.setEmptyResultMessage("No external sources found in Perun.");
    }

    dataProvider.flush();
    dataProvider.refresh();
    loaderImage.loadingFinished();
  }
示例#2
0
 private void selection(Boolean select) {
   if (dataProvider.getFilter() != null && !dataProvider.getFilter().isEmpty()) {
     selectionModel.clear();
     for (int i = 0; i < dataProvider.resulted.size(); i++) {
       selectionModel.setSelected(dataProvider.resulted.get(i), select);
     }
   } else {
     selectionModel.clear();
     for (int i = 0; i < data.size(); i++) {
       selectionModel.setSelected(data.get(i), select);
     }
   }
 }
 /** Clear all table content */
 public void clearTable() {
   loaderImage.loadingStart();
   list.clear();
   selectionModel.clear();
   dataProvider.flush();
   dataProvider.refresh();
 }
  @Override
  public void clear() {
    setReadOnly(false);
    if (selection != null) {
      selection.clear();
    }
    selectedPersons.clear();
    personList.clear();

    acceptableValues.clear();
    person.setValue(null);
    person.setAcceptableValues(acceptableValues);
  }
  @Override
  public void setPersons(List<Person> persons) {
    acceptableValues.clear();
    if (persons != null) {
      acceptableValues.addAll(persons);
    }
    if (acceptableValues.size() > 0) {
      person.setValue(acceptableValues.get(0));
    }
    person.setAcceptableValues(acceptableValues);

    if (selection != null) {
      selection.clear();
    }
    selectedPersons.clear();
    personList.clear();
  }
示例#6
0
    @Override
    public void onSelectionChange(SelectionChangeEvent event) {

      Set<TaskDataDto> selected =
          ((MultiSelectionModel<TaskDataDto>) event.getSource()).getSelectedSet();
      List<TaskDataDto> result = new ArrayList<TaskDataDto>(selected);

      TaskDataTreeViewModel taskDataTreeViewModel =
          (TaskDataTreeViewModel) taskDetailsTree.getTreeViewModel();
      MultiSelectionModel<PlotNameDto> plotNameSelectionModel =
          taskDataTreeViewModel.getSelectionModel();

      // chosen plots
      Set<PlotNameDto> plotTempSet = plotNameSelectionModel.getSelectedSet();
      // chosen metrics
      Set<MetricNameDto> metricTempSet = metricPanel.getSelected();

      chosenPlots.clear();
      // Clear markings dto map
      markingsMap.clear();
      taskDataTreeViewModel.clear();
      plotNameSelectionModel.clear();
      metricPanel.updateTests(result);
      taskDataTreeViewModel.populateTaskList(result);
      // Populate available plots tree level for each task for selected session
      for (TaskDataDto taskDataDto : result) {
        taskDataTreeViewModel
            .getPlotNameDataProviders()
            .put(
                taskDataDto,
                new TaskPlotNamesAsyncDataProvider(taskDataDto, summaryPanel.getSessionIds()));
      }
      summaryPanel.updateTests(result);

      if (selectTests) {
        makeSelectionForMetricPanel(metricTempSet, metricPanel, result);
        makeSelectionForTaskDetailsTree(plotTempSet, plotNameSelectionModel, result);
      } else {
        selectTests = true;
        ifItWasLink(result, metricPanel, taskDataTreeViewModel);
      }

      metricTempSet.clear();
      plotTempSet.clear();
    }
示例#7
0
  public void filterTable(String text) {

    // store list only for first time
    if (fullBackup.isEmpty() || fullBackup == null) {
      fullBackup.addAll(list);
    }

    // always clear selected items
    selectionModel.clear();
    list.clear();

    if (text.equalsIgnoreCase("")) {
      list.addAll(fullBackup);
    } else {
      for (Destination dst : fullBackup) {
        // store facility by filter
        if (service == null) {
          if (dst.getDestination().toLowerCase().contains(text.toLowerCase())
              || dst.getService().getName().toLowerCase().contains(text.toLowerCase())) {
            list.add(dst);
          }
        } else {
          if (dst.getDestination().toLowerCase().contains(text.toLowerCase())
              || dst.getFacility().getName().toLowerCase().contains(text.toLowerCase())) {
            list.add(dst);
          }
        }
      }
    }

    if (list.isEmpty() && !text.isEmpty()) {
      loaderImage.setEmptyResultMessage("No destination matching '" + text + "' found.");
    } else {
      if (showFac) {
        loaderImage.setEmptyResultMessage("Service has no destination.");
      } else {
        loaderImage.setEmptyResultMessage(
            "Facility has no services destinations. Service configuration can't be propagated.");
      }
    }

    dataProvider.flush();
    dataProvider.refresh();
    loaderImage.loadingFinished();
  }
示例#8
0
    private void updateTests(List<TaskDataDto> tests) {

      MultiSelectionModel<TaskDataDto> model =
          (MultiSelectionModel) testDataGrid.getSelectionModel();
      previousSelectedSet.addAll(model.getSelectedSet());

      model.clear();
      testDataGrid.redraw();
      testDataGrid.setRowData(tests);

      if (chosenSessions.size() == 1) {
        metricPanel.getSelectionModel().clear();
        final boolean selectTestsFinal = selectTests;
        final String sessionId = chosenSessions.get(0);
        PlotProviderService.Async.getInstance()
            .getSessionScopePlotList(
                sessionId,
                new AsyncCallback<Set<String>>() {
                  @Override
                  public void onFailure(Throwable throwable) {
                    throwable.printStackTrace();
                  }

                  @Override
                  public void onSuccess(Set<String> plotNames) {
                    sessionPlotPanel.update(sessionId, plotNames);
                    if (!selectTestsFinal) {
                      sessionPlotPanel.setSelected(place.getSessionTrends());
                    }
                    sessionPlotPanel
                        .getSelectionModel()
                        .addSelectionChangeHandler(new SessionScopePlotSelectionChangedHandler());
                    SelectionChangeEvent.fire(sessionPlotPanel.getSelectionModel());
                  }
                });
      }
      makeSelectionOnTaskDataGrid(model, tests);
    }
 /** Clears list of selected items */
 public void clearTableSelectedSet() {
   selectionModel.clear();
 }
示例#10
0
 @UiHandler("uncheckSessionsButton")
 void handleUncheckSessionsButtonClick(ClickEvent e) {
   MultiSelectionModel model = (MultiSelectionModel<?>) sessionsDataGrid.getSelectionModel();
   model.clear();
 }
示例#11
0
 @Override
 public void clearSelection() {
   selection.clear();
 }
示例#12
0
 public void refresh() {
   selectionModel.clear();
   cellTable.setVisibleRangeAndClearData(cellTable.getVisibleRange(), true);
 }
示例#13
0
 public void actualizarGrid() {
   this.setVisibleRangeAndClearData(this.getVisibleRange(), true);
   selectionModel.clear();
 }