Exemplo n.º 1
0
  /**
   * Adds a new <tt>ConfigurationForm</tt> to this list.
   *
   * @param configForm The <tt>ConfigurationForm</tt> to add.
   */
  public void addConfigForm(ConfigurationForm configForm) {
    if (configForm == null) throw new IllegalArgumentException("configForm");

    DefaultListModel listModel = (DefaultListModel) configList.getModel();

    int i = 0;
    int count = listModel.getSize();
    int configFormIndex = configForm.getIndex();
    for (; i < count; i++) {
      ConfigurationForm form = (ConfigurationForm) listModel.get(i);

      if (configFormIndex < form.getIndex()) break;
    }
    listModel.add(i, configForm);
  }
  public void setMap(
      HashMap map,
      JTextArea textArea,
      JTextField[] textFields,
      JLabel[] labels,
      JLabel actionLabel) {
    this.map = map;
    this.textArea = textArea;
    this.textFields = textFields;
    this.labels = labels;
    this.table = table;
    this.action = actionLabel;

    int index = 0;
    for (Object o : map.keySet().toArray()) {
      listModel.add(index, o.toString());
      index++;
    }
  }