/**
   * Performs a search for the given string. Limits the display of rows to ones containing the
   * search string.
   *
   * @param searchString the string to search for
   * @param regexp whether to perform regular expression matching or just plain string comparison
   */
  public synchronized void search(String searchString, boolean regexp) {
    int[] selected;
    int i;
    int index;

    // determine actual selected rows
    selected = getSelectedRows();
    for (i = 0; i < selected.length; i++) selected[i] = getActualRow(selected[i]);

    m_Model.search(searchString, regexp);

    // re-select rows that are still in current search
    clearSelection();
    for (i = 0; i < selected.length; i++) {
      index = getDisplayRow(selected[i]);
      if (index != -1) getSelectionModel().addSelectionInterval(index, index);
    }
  }