@Override
      public void valueChanged(ListSelectionEvent e) {
        ListSelectionModel selectionModel = (ListSelectionModel)e.getSource();
        int lastIndex = e.getLastIndex();
        int firstIndex = e.getFirstIndex();
        DirDiffElementImpl last = myModel.getElementAt(lastIndex);
        DirDiffElementImpl first = myModel.getElementAt(firstIndex);

        // Since we can't select the separator, we need to save it somehow. See com.intellij.openapi.diff.impl.dir.actions.popup.ExcludeAction
        if (last != null && last.isSeparator()) {
          myModel.setSelectedSeparator(last);
        }
        else {
          myModel.setSelectedSeparator(null);
        }
        if (last == null || first == null) {
          update(false);
          return;
        }
        if (last.isSeparator() && selectionModel.isSelectedIndex(lastIndex)) {
          int ind = lastIndex + ((lastIndex < firstIndex) ? 1 : -1);
          selectionModel.addSelectionInterval(ind, ind);
        }
        if (first.isSeparator() && selectionModel.isSelectedIndex(firstIndex)) {
          int ind = firstIndex + ((firstIndex < lastIndex) ? 1 : -1);
          selectionModel.addSelectionInterval(ind, ind);
        }
        else {
          update(false);
        }
        myDiffWindow.setTitle(myModel.getTitle());
      }
@Override
      public void valueChanged(ListSelectionEvent e)