aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBernard Leach2011-07-10 02:02:19 (EDT)
committerBernard Leach2011-07-10 02:02:19 (EDT)
commit2cbdb149e64d00ce161f556220cf5aabb212e4e3 (patch)
treebdd6ddcc3fc471fbfd9c043b02adc4f4cd9b1d18
parent6479ec6ceafc68c3226b9853e05c0d3041bf311b (diff)
downloadegit-2cbdb149e64d00ce161f556220cf5aabb212e4e3.zip
egit-2cbdb149e64d00ce161f556220cf5aabb212e4e3.tar.gz
egit-2cbdb149e64d00ce161f556220cf5aabb212e4e3.tar.bz2
Re-use compare editor in CompareWithIndexHandlerrefs/changes/59/3859/1
-rw-r--r--org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/actions/CompareWithIndexActionHandler.java9
1 files changed, 6 insertions, 3 deletions
diff --git a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/actions/CompareWithIndexActionHandler.java b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/actions/CompareWithIndexActionHandler.java
index 4c7d413..c59ce64 100644
--- a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/actions/CompareWithIndexActionHandler.java
+++ b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/actions/CompareWithIndexActionHandler.java
@@ -13,7 +13,6 @@ import java.io.ByteArrayInputStream;
import java.io.IOException;
import java.io.InputStream;
-import org.eclipse.compare.CompareUI;
import org.eclipse.compare.IContentChangeListener;
import org.eclipse.compare.IContentChangeNotifier;
import org.eclipse.compare.ITypedElement;
@@ -25,21 +24,24 @@ import org.eclipse.egit.core.internal.storage.GitFileRevision;
import org.eclipse.egit.core.project.RepositoryMapping;
import org.eclipse.egit.ui.Activator;
import org.eclipse.egit.ui.UIText;
+import org.eclipse.egit.ui.internal.CompareUtils;
import org.eclipse.egit.ui.internal.EditableRevision;
import org.eclipse.egit.ui.internal.GitCompareFileRevisionEditorInput;
import org.eclipse.egit.ui.internal.dialogs.CompareTreeView;
import org.eclipse.jgit.dircache.DirCache;
import org.eclipse.jgit.dircache.DirCacheEditor;
-import org.eclipse.jgit.dircache.DirCacheEntry;
import org.eclipse.jgit.dircache.DirCacheEditor.PathEdit;
+import org.eclipse.jgit.dircache.DirCacheEntry;
import org.eclipse.jgit.lib.Constants;
import org.eclipse.jgit.lib.ObjectInserter;
import org.eclipse.jgit.lib.Repository;
import org.eclipse.osgi.util.NLS;
import org.eclipse.team.core.history.IFileRevision;
import org.eclipse.team.ui.synchronize.SaveableCompareEditorInput;
+import org.eclipse.ui.IWorkbenchPage;
import org.eclipse.ui.PartInitException;
import org.eclipse.ui.PlatformUI;
+import org.eclipse.ui.handlers.HandlerUtil;
/**
* The "compare with index" action. This action opens a diff editor comparing
@@ -71,7 +73,8 @@ public class CompareWithIndexActionHandler extends RepositoryActionHandler {
final GitCompareFileRevisionEditorInput in = new GitCompareFileRevisionEditorInput(
base, next, null);
- CompareUI.openCompareEditor(in);
+ IWorkbenchPage workBenchPage = HandlerUtil.getActiveWorkbenchWindowChecked(event).getActivePage();
+ CompareUtils.openInCompare(workBenchPage, in);
} else {
CompareTreeView view;
try {