code: protected void addDatastreamTab(String dsID, boolean reInitNewPanel)
              throws Exception {
          DatastreamPane[] newArray =
                  new DatastreamPane[m_datastreamPanes.length + 1];
          for (int i = 0; i < m_datastreamPanes.length; i++) {
              newArray[i] = m_datastreamPanes[i];
          }
          List<Datastream> versions =
                  Administrator.APIM.getDatastreamHistory(m_pid, dsID);
          m_currentVersionMap.put(dsID, versions.get(0));
          newArray[m_datastreamPanes.length] =
                  new DatastreamPane(m_owner, m_pid, versions, this);
          // swap the arrays
          m_datastreamPanes = newArray;
          int newIndex = getTabIndex("New...");
          m_tabbedPane.add(m_datastreamPanes[m_datastreamPanes.length - 1],
                           newIndex);
          m_tabbedPane.setTitleAt(newIndex, dsID);
          m_tabbedPane.setToolTipTextAt(newIndex, versions.get(0).getMIMEType()
                  + " - " + versions.get(0).getLabel() + " ("
                  + versions.get(0).getControlGroup().toString() + ")");
          colorTabForState(dsID, versions.get(0).getState());
          if (reInitNewPanel) {
              doNew(XML_MIMETYPE, false);
          }
  
          updateNewRelsExt(m_pid);
          m_tabbedPane.setSelectedIndex(getTabIndex(dsID));
      }
docs: Add a new tab with a new datastream.