Exemplo n.º 1
0
 /**
  * Saves all Gefaehrdungen associated to the chosen IT-system in a List.
  *
  * @throws CommandException
  */
 private void loadAssociatedGefaehrdungen() {
   try {
     LoadAssociatedGefaehrdungen command = new LoadAssociatedGefaehrdungen(cnaElement);
     command = ServiceFactory.lookupCommandService().executeCommand(command);
     this.finishedRiskLists
         .getAssociatedGefaehrdungen()
         .addAll(command.getAssociatedGefaehrdungen());
   } catch (CommandException e) {
     ExceptionUtil.log(e, Messages.RiskAnalysisWizard_5);
   }
 }
  /** 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$
    }
  }