Пример #1
0
  private void displayButtons(Rule rule) {
    clearButtons();

    for (String key : rule) {
      try {
        DataElement ele = allVars.getDataElement(key);

        if (ele.getTitle() != null) {
          NameButton nb = new NameButton(ele);
          nb.addActionListener(this::NameButtonActionPerformed);
          buttonPanel.add(nb);
        }
      } catch (Exception e) {
        Logging.errorPrint(e.getMessage(), e);
      }
    }

    buttonPanel.repaint();
  }
Пример #2
0
  private void loadStructureDD() {
    if (chkStructure.isSelected()) {
      cbStructure.setModel(new DefaultComboBoxModel());
      cbStructure.setEnabled(false);
    } else {
      Vector<DataElement> struct = new Vector<>();

      for (String key : ((RuleSet) cbCatalog.getSelectedItem())) {
        try {
          struct.add(allVars.getDataElement(key));
        } catch (Exception e) {
          Logging.errorPrint(e.getMessage(), e);
        }
      }

      DefaultComboBoxModel structModel = new DefaultComboBoxModel(struct);
      cbStructure.setModel(structModel);
      cbStructure.setEnabled(true);
    }
  }