コード例 #1
0
  /*public int getAssociationMode()
  {
  return Integer.valueOf(((Radiogroup) getFellow("rgMode")).getSelectedItem().getValue().toString());  // TODO überprüfen, ob .toString() funktionert
  }*/
  public void update(Object o) {
    if (o != null) logger.debug("Update Association-Editor: " + o.getClass().getCanonicalName());

    if (o != null && o instanceof CodeSystemEntityVersionAssociation) {
      CodeSystemEntityVersionAssociation cseva = (CodeSystemEntityVersionAssociation) o;
      cseva.getCodeSystemEntityVersionByCodeSystemEntityVersionId1().setCodeSystemEntity(null);
      cseva.getCodeSystemEntityVersionByCodeSystemEntityVersionId2().setCodeSystemEntity(null);

      Radiogroup rg = (Radiogroup) getFellow("rgAssociationKind");
      if (rg.getSelectedIndex() == 0)
        cseva.setAssociationKind(Definitions.ASSOCIATION_KIND.ONTOLOGY.getCode());
      else if (rg.getSelectedIndex() == 1)
        cseva.setAssociationKind(Definitions.ASSOCIATION_KIND.TAXONOMY.getCode());
      else if (rg.getSelectedIndex() == 2)
        cseva.setAssociationKind(Definitions.ASSOCIATION_KIND.CROSS_MAPPING.getCode());
      else if (rg.getSelectedIndex() == 3)
        cseva.setAssociationKind(Definitions.ASSOCIATION_KIND.LINK.getCode());

      GenericListRowType row = createRow(cseva);
      genericList.addEntry(row, 0);
    }
  }
コード例 #2
0
  private void initList() {
    // incList
    List<GenericListHeaderType> header = new LinkedList<GenericListHeaderType>();
    header.add(
        new GenericListHeaderType(
            Labels.getLabel("common.code"), 0, "", true, "String", true, true, false, false));
    header.add(
        new GenericListHeaderType(
            Labels.getLabel("common.relation"), 130, "", true, "String", true, true, false, false));
    header.add(
        new GenericListHeaderType(
            Labels.getLabel("common.code"), 0, "", true, "String", true, true, false, false));

    List<GenericListRowType> dataList = new LinkedList<GenericListRowType>();

    /*for (MetadataParameter meta : valueSet.getMetadataParameters())
    {
    GenericListRowType row = createRowFromMetadataParameter(meta);
    dataList.add(row);
    }*/
    // Liste initialisieren
    Include inc = (Include) getFellow("incList");
    Window winGenericList = (Window) inc.getFellow("winGenericList");
    genericList = (GenericList) winGenericList;

    // genericList.setUserDefinedId("1");
    genericList.setListActions(this);
    genericList.setButton_new(false);
    genericList.setButton_edit(false);
    genericList.setButton_delete(true);
    genericList.setListHeader(header);
    genericList.setDataList(dataList);

    genericList.removeCustomButtons();

    Button buttonAuto =
        new Button(
            Labels.getLabel("common.automatic") + "...", "/rsc/img/design/automatic_16x16.png");
    buttonAuto.addEventListener(
        Events.ON_CLICK,
        new EventListener<Event>() {
          public void onEvent(Event t) throws Exception {
            automaticAssociations();
          }
        });
    buttonAuto.setAttribute("disabled", false);
    buttonAuto.setAttribute("right", true);
    genericList.addCustomButton(buttonAuto);

    Button button = new Button(Labels.getLabel("common.save"), "/rsc/img/design/save_16x16.png");
    button.addEventListener(
        Events.ON_CLICK,
        new EventListener<Event>() {
          public void onEvent(Event t) throws Exception {
            saveAssociations();
          }
        });
    button.setAttribute("disabled", false);
    button.setAttribute("right", true);

    genericList.addCustomButton(button);
  }