コード例 #1
0
  private void checkAllSelectedGefaehrdungen() {
    List<Gefaehrdung> toCheck = new ArrayList<Gefaehrdung>();
    for (GefaehrdungsUmsetzung associatedGefaehrdung : wizard.getAssociatedGefaehrdungen()) {
      for (Gefaehrdung gefaehrdung : wizard.getAllGefaehrdungen()) {
        if (gefaehrdung.getId().equals(associatedGefaehrdung.getId())) {
          toCheck.add(gefaehrdung);
        }
      }
    }

    Gefaehrdung[] checkarray = toCheck.toArray(new Gefaehrdung[toCheck.size()]);
    viewer.setCheckedElements(checkarray);
  }
コード例 #2
0
  /** Marks all checkboxes of Gefaehrdungen associated to the selected Baustein. */
  private void assignBausteinGefaehrdungen() {
    try {
      LoadAssociatedGefaehrdungen command = new LoadAssociatedGefaehrdungen(wizard.getCnaElement());
      command = ServiceFactory.lookupCommandService().executeCommand(command);
      List<GefaehrdungsUmsetzung> list = command.getAssociatedGefaehrdungen();

      for (GefaehrdungsUmsetzung selectedGefaehrdung : list) {
        for (Gefaehrdung gefaehrdung : wizard.getAllGefaehrdungen()) {
          if (gefaehrdung.getId().equals(selectedGefaehrdung.getId())) {
            associateGefaehrdung(gefaehrdung, true);
          }
        }
      }
    } catch (CommandException e) {
      ExceptionUtil.log(e, ""); // $NON-NLS-1$
    }
  }