@NotNull
  protected ChangesSelection getChangesSelection() {
    final Change leadSelection = ObjectUtils.tryCast(myViewer.getLeadSelection(), Change.class);
    List<Change> changes = getSelectedChanges();

    if (changes.size() < 2) {
      List<Change> allChanges = getAllChanges();
      if (allChanges.size() > 1 || changes.isEmpty()) {
        changes = allChanges;
      }
    }

    if (leadSelection != null) {
      int indexInSelection = changes.indexOf(leadSelection);
      if (indexInSelection == -1) {
        return new ChangesSelection(Collections.singletonList(leadSelection), 0);
      } else {
        return new ChangesSelection(changes, indexInSelection);
      }
    } else {
      return new ChangesSelection(changes, 0);
    }
  }
 @NotNull
 public List<VirtualFile> getIncludedUnversionedFiles() {
   return Collections.emptyList();
 }
 @NotNull
 public List<Change> getCurrentDisplayedChanges() {
   return mySelectedChangeList != null
       ? ContainerUtil.newArrayList(mySelectedChangeList.getChanges())
       : Collections.emptyList();
 }