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
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
-rw-r--r--bundles/org.eclipse.compare/compare/org/eclipse/compare/CompareEditorInput.java12
-rw-r--r--bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/CompareEditor.java7
-rw-r--r--bundles/org.eclipse.compare/plugins/org.eclipse.compare/compare/org/eclipse/compare/CompareEditorInput.java12
-rw-r--r--bundles/org.eclipse.compare/plugins/org.eclipse.compare/compare/org/eclipse/compare/internal/CompareEditor.java7
4 files changed, 34 insertions, 4 deletions
diff --git a/bundles/org.eclipse.compare/compare/org/eclipse/compare/CompareEditorInput.java b/bundles/org.eclipse.compare/compare/org/eclipse/compare/CompareEditorInput.java
index 36e93c36d..672f8fa6e 100644
--- a/bundles/org.eclipse.compare/compare/org/eclipse/compare/CompareEditorInput.java
+++ b/bundles/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;
}
+
}
diff --git a/bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/CompareEditor.java b/bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/CompareEditor.java
index c06bbf2a4..28d7fac22 100644
--- a/bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/CompareEditor.java
+++ b/bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/CompareEditor.java
@@ -32,8 +32,7 @@ import org.eclipse.swt.layout.GridLayout;
import org.eclipse.swt.widgets.*;
import org.eclipse.ui.*;
import org.eclipse.ui.actions.WorkspaceModifyOperation;
-import org.eclipse.ui.part.EditorPart;
-import org.eclipse.ui.part.PageBook;
+import org.eclipse.ui.part.*;
import org.eclipse.ui.services.IServiceLocator;
import org.eclipse.ui.views.contentoutline.IContentOutlinePage;
@@ -142,6 +141,10 @@ public class CompareEditor extends EditorPart implements IReusableEditor, ISavea
}
}
}
+
+ if (key.equals(IShowInSource.class)) {
+ return getEditorInput().getAdapter(key);
+ }
return super.getAdapter(key);
}
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;
}
+
}
diff --git a/bundles/org.eclipse.compare/plugins/org.eclipse.compare/compare/org/eclipse/compare/internal/CompareEditor.java b/bundles/org.eclipse.compare/plugins/org.eclipse.compare/compare/org/eclipse/compare/internal/CompareEditor.java
index c06bbf2a4..28d7fac22 100644
--- a/bundles/org.eclipse.compare/plugins/org.eclipse.compare/compare/org/eclipse/compare/internal/CompareEditor.java
+++ b/bundles/org.eclipse.compare/plugins/org.eclipse.compare/compare/org/eclipse/compare/internal/CompareEditor.java
@@ -32,8 +32,7 @@ import org.eclipse.swt.layout.GridLayout;
import org.eclipse.swt.widgets.*;
import org.eclipse.ui.*;
import org.eclipse.ui.actions.WorkspaceModifyOperation;
-import org.eclipse.ui.part.EditorPart;
-import org.eclipse.ui.part.PageBook;
+import org.eclipse.ui.part.*;
import org.eclipse.ui.services.IServiceLocator;
import org.eclipse.ui.views.contentoutline.IContentOutlinePage;
@@ -142,6 +141,10 @@ public class CompareEditor extends EditorPart implements IReusableEditor, ISavea
}
}
}
+
+ if (key.equals(IShowInSource.class)) {
+ return getEditorInput().getAdapter(key);
+ }
return super.getAdapter(key);
}

Back to the top