Пример #1
0
  private void onProblemSelected(Problem selectedProblem) {
    ProblemAndSubmissionReceipt[] data = page.getSession().get(ProblemAndSubmissionReceipt[].class);
    SingleSelectionModel<? super ProblemAndSubmissionReceipt> sm =
        (SingleSelectionModel<? super ProblemAndSubmissionReceipt>) cellTable.getSelectionModel();
    for (ProblemAndSubmissionReceipt p : data) {
      if (p.getProblem().getProblemId().equals(selectedProblem.getProblemId())) {
        // Found the selected problem, so change the selected row
        sm.clear();
        sm.setSelected(p, true);
        return;
      }
    }

    // The selected problem isn't being viewed currently,
    // so just clear the selection
    sm.clear();
  }
Пример #2
0
 public void update(final List<Property> models) {
   dataProvider.setList(models);
   if (models.isEmpty()) {
     selectionModel.clear();
   } else {
     table.selectDefaultEntity();
   }
   SelectionChangeEvent.fire(
       selectionModel); // updates ModelNodeForm's editedEntity with current value
 }
Пример #3
0
  public void update(Property prop) {
    permissionMapping = prop.getName();
    if (prop.getValue().hasDefined("permissions")) {
      List<ModelNode> models = prop.getValue().get("permissions").asList();
      table.setRowCount(models.size(), true);

      List<ModelNode> dataList = dataProvider.getList();
      dataList.clear(); // cannot call setList() as that breaks the sort handler
      dataList.addAll(models);
    } else {
      clearValues();
    }
    selectionModel.clear();
  }
  public void update(Property prop) {
    authContextName = prop.getName();
    if (prop.getValue().hasDefined(MATCH_RULES)) {
      List<ModelNode> models = prop.getValue().get(MATCH_RULES).asList();
      table.setRowCount(models.size(), true);

      List<ModelNode> dataList = dataProvider.getList();
      dataList.clear();
      dataList.addAll(models);
    } else {
      clearValues();
    }
    selectionModel.clear();
  }
Пример #5
0
  @UiHandler("newButton")
  public void handleAddNewOrganism(ClickEvent clickEvent) {
    creatingNewOrganism = true;
    clearTextBoxes();
    singleSelectionModel.clear();

    createButton.setText("Create Organism");
    deleteButton.setText("Delete Organism");
    newButton.setEnabled(false);
    cancelButton.setEnabled(true);
    createButton.setEnabled(true);

    createButton.setVisible(true);
    cancelButton.setVisible(true);
    newButton.setVisible(true);
    deleteButton.setVisible(false);

    setTextEnabled(true);
  }
Пример #6
0
 @Override
 public void clearSelection() {
   selectionModel.clear();
 }