Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Valenta2007-01-05 01:05:22 +0000
committerMichael Valenta2007-01-05 01:05:22 +0000
commit1a388c39feab96c111b5a3bab004793cbd4bad86 (patch)
treebf878838b0238a1df068a2041bada71af1b8d740 /bundles/org.eclipse.compare/plugins/org.eclipse.compare/compare/org/eclipse/compare/CompareEditorInput.java
parent2b623b4aef655884d9f3cbb47a41cc9a4a19acbb (diff)
downloadeclipse.platform.team-1a388c39feab96c111b5a3bab004793cbd4bad86.tar.gz
eclipse.platform.team-1a388c39feab96c111b5a3bab004793cbd4bad86.tar.xz
eclipse.platform.team-1a388c39feab96c111b5a3bab004793cbd4bad86.zip
Bug 165762 [Edit] Compare editors should support Navigate > Show In
Diffstat (limited to 'bundles/org.eclipse.compare/plugins/org.eclipse.compare/compare/org/eclipse/compare/CompareEditorInput.java')
-rw-r--r--bundles/org.eclipse.compare/plugins/org.eclipse.compare/compare/org/eclipse/compare/CompareEditorInput.java12
1 files changed, 12 insertions, 0 deletions
diff --git a/bundles/org.eclipse.compare/plugins/org.eclipse.compare/compare/org/eclipse/compare/CompareEditorInput.java b/bundles/org.eclipse.compare/plugins/org.eclipse.compare/compare/org/eclipse/compare/CompareEditorInput.java
index 36e93c36d..672f8fa6e 100644
--- a/bundles/org.eclipse.compare/plugins/org.eclipse.compare/compare/org/eclipse/compare/CompareEditorInput.java
+++ b/bundles/org.eclipse.compare/plugins/org.eclipse.compare/compare/org/eclipse/compare/CompareEditorInput.java
@@ -17,6 +17,7 @@ import java.util.ResourceBundle;
import org.eclipse.compare.contentmergeviewer.IFlushable;
import org.eclipse.compare.internal.*;
import org.eclipse.compare.structuremergeviewer.*;
+import org.eclipse.core.resources.IFile;
import org.eclipse.core.runtime.*;
import org.eclipse.core.runtime.jobs.Job;
import org.eclipse.jface.action.*;
@@ -37,6 +38,7 @@ import org.eclipse.swt.graphics.Image;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Control;
import org.eclipse.ui.*;
+import org.eclipse.ui.part.*;
import org.eclipse.ui.services.IServiceLocator;
@@ -214,6 +216,15 @@ public abstract class CompareEditorInput implements IEditorInput, IPropertyChang
if (ICompareNavigator.class.equals(adapter) || CompareNavigator.class.equals(adapter)) {
return getNavigator();
}
+ if (adapter == IShowInSource.class) {
+ final IFile file = (IFile)Utilities.getAdapter(this, IFile.class);
+ if (file != null)
+ return new IShowInSource() {
+ public ShowInContext getShowInContext() {
+ return new ShowInContext(new FileEditorInput(file), StructuredSelection.EMPTY);
+ }
+ };
+ }
return null;
}
@@ -1120,5 +1131,6 @@ public abstract class CompareEditorInput implements IEditorInput, IPropertyChang
public void setHelpContextId(String helpContextId) {
this.fHelpContextId = helpContextId;
}
+
}

Back to the top