private void closeResultTab(ResultTab tab) {
   if (tab == null) {
     throw new IllegalArgumentException("Null ResultTab passed");
   }
   s_log.debug("SQLPanel.closeResultTab(" + tab.getIdentifier().toString() + ")");
   tab.closeTab();
   _tabbedExecutionsPanel.remove(tab);
 }
  /**
   * Return the passed tab back into the tabbed pane.
   *
   * @param tab <TT>Resulttab</TT> to be returned
   * @throws IllegalArgumentException Thrown if a <TT>null</TT> <TT>ResultTab</TT> passed.
   */
  private void returnToTabbedPane(ResultTab tab) {
    if (tab == null) {
      throw new IllegalArgumentException("Null ResultTab passed");
    }

    s_log.debug("SQLPanel.returnToTabbedPane(" + tab.getIdentifier().toString() + ")");

    for (ResultFrame sqlResultFrame : _sqlResultFrames) {
      if (tab == sqlResultFrame.getTab()) {
        _sqlResultFrames.remove(sqlResultFrame);
        break;
      }
    }

    addResultsTab(tab, null);
  }
  /**
   * Create an internal frame for the specified tab and display the tab in the internal frame after
   * removing it from the tabbed pane.
   *
   * @param tab <TT>ResultTab</TT> to be displayed in an internal frame.
   * @throws IllegalArgumentException Thrown if a <TT>null</TT> <TT>ResultTab</TT> passed.
   */
  private void createSQLResultFrame(ResultTab tab) {
    if (tab == null) {
      throw new IllegalArgumentException("Null ResultTab passed");
    }
    s_log.debug("SQLPanel.createSQLResultFrame(" + tab.getIdentifier().toString() + ")");
    _tabbedExecutionsPanel.remove(tab);

    ResultFrameListener resultFrameListener =
        new ResultFrameListener() {
          @Override
          public void frameReplaced(ResultFrame oldFrame, ResultFrame newFrame) {
            onFrameReplaced(oldFrame, newFrame);
          }
        };

    ResultFrame frame =
        new ResultFrame(_session, tab, _resultTabFactory, resultFrameListener, true, false);
    _sqlResultFrames.add(frame);
  }