Exemplo n.º 1
0
  /**
   * Load in the {@link ucar.unidata.idv.ui.ParamInfo}-s defined in the xml from the given root
   * Element. Create a new JTable and add it into the GUI.
   *
   * @param root The xml root
   * @param i Which resource is this
   */
  private void addList(Element root, int i) {
    List infos;
    boolean isWritable = resources.isWritableResource(i);
    if (root != null) {
      infos = createParamInfoList(root);
    } else {
      if (!isWritable) {
        return;
      }
      infos = new ArrayList();
    }

    if (infos.size() == 0) {
      //            infos.add(new ParamInfo("", null, null, null, null));
    }
    ParamDefaultsTable table = new ParamDefaultsTable(infos, isWritable);
    table.setPreferredScrollableViewportSize(new Dimension(500, 70));
    String editableStr = "";
    if (!isWritable) {
      editableStr = " (" + Msg.msg("non-editable") + ") ";
    }
    JLabel label =
        new JLabel(
            "<html>" + Msg.msg("Path: ${param1}", resources.get(i) + editableStr) + "</html>");
    JPanel tablePanel = GuiUtils.topCenter(GuiUtils.inset(label, 4), new JScrollPane(table));

    table.label = resources.getShortName(i);
    tableTabbedPane.add(resources.getShortName(i), tablePanel);
    myTables.add(table);
  }