Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNitin Dahyabhai2019-10-16 21:09:54 +0000
committerNitin Dahyabhai2019-10-17 19:55:38 +0000
commitfd1487044dc6a945dc3b5225767f36c040bab041 (patch)
tree310e862752d3742e8a986b7016d3e4b8327460b6 /org.eclipse.ui.editors
parent235ef3321fb147795b18c9d0df1b2ca2f401c825 (diff)
downloadeclipse.platform.text-fd1487044dc6a945dc3b5225767f36c040bab041.tar.gz
eclipse.platform.text-fd1487044dc6a945dc3b5225767f36c040bab041.tar.xz
eclipse.platform.text-fd1487044dc6a945dc3b5225767f36c040bab041.zip
Bug 537617 - Minimap should appear in editor's 'Show In' context menuI20191020-1800
Change-Id: I089bfdd23c1358f597fc322924d6098e5d6f5293 Signed-off-by: Nitin Dahyabhai <nitind@us.ibm.com>
Diffstat (limited to 'org.eclipse.ui.editors')
-rw-r--r--org.eclipse.ui.editors/META-INF/MANIFEST.MF3
-rw-r--r--org.eclipse.ui.editors/src/org/eclipse/ui/texteditor/AbstractDecoratedTextEditor.java28
2 files changed, 30 insertions, 1 deletions
diff --git a/org.eclipse.ui.editors/META-INF/MANIFEST.MF b/org.eclipse.ui.editors/META-INF/MANIFEST.MF
index ff421860f5b..395f4ff0756 100644
--- a/org.eclipse.ui.editors/META-INF/MANIFEST.MF
+++ b/org.eclipse.ui.editors/META-INF/MANIFEST.MF
@@ -21,7 +21,8 @@ Require-Bundle:
org.eclipse.ui.ide;bundle-version="[3.5.0,4.0.0)",
org.eclipse.ui;bundle-version="[3.5.0,4.0.0)",
org.eclipse.jface.text;bundle-version="[3.8.0,4.0.0)",
- org.eclipse.ui.workbench.texteditor;bundle-version="[3.13.0,4.0.0)",
+ org.eclipse.ui.workbench;bundle-version="[3.117.0,4.0.0)",
+ org.eclipse.ui.workbench.texteditor;bundle-version="[3.14.0,4.0.0)",
org.eclipse.core.filebuffers;visibility:=reexport;bundle-version="[3.5.0,4.0.0)",
org.eclipse.core.resources;bundle-version="[3.5.0,4.0.0)",
org.eclipse.core.filesystem;bundle-version="[1.2.0,2.0.0)"
diff --git a/org.eclipse.ui.editors/src/org/eclipse/ui/texteditor/AbstractDecoratedTextEditor.java b/org.eclipse.ui.editors/src/org/eclipse/ui/texteditor/AbstractDecoratedTextEditor.java
index 546d8225d48..bccb48b91a2 100644
--- a/org.eclipse.ui.editors/src/org/eclipse/ui/texteditor/AbstractDecoratedTextEditor.java
+++ b/org.eclipse.ui.editors/src/org/eclipse/ui/texteditor/AbstractDecoratedTextEditor.java
@@ -121,6 +121,7 @@ import org.eclipse.ui.IEditorDescriptor;
import org.eclipse.ui.IEditorInput;
import org.eclipse.ui.IEditorPart;
import org.eclipse.ui.IFileEditorInput;
+import org.eclipse.ui.IPageLayout;
import org.eclipse.ui.IURIEditorInput;
import org.eclipse.ui.IWorkbenchActionConstants;
import org.eclipse.ui.IWorkbenchCommandConstants;
@@ -151,6 +152,7 @@ import org.eclipse.ui.keys.IBindingService;
import org.eclipse.ui.operations.NonLocalUndoUserApprover;
import org.eclipse.ui.part.FileEditorInput;
import org.eclipse.ui.part.IShowInSource;
+import org.eclipse.ui.part.IShowInTargetList;
import org.eclipse.ui.part.ShowInContext;
import org.eclipse.ui.views.markers.MarkerViewUtil;
@@ -1428,6 +1430,9 @@ public abstract class AbstractDecoratedTextEditor extends StatusTextEditor {
if (MarkerAnnotationPreferences.class.equals(adapter))
return (T) EditorsPlugin.getDefault().getMarkerAnnotationPreferences();
+ if (IShowInTargetList.class.equals(adapter))
+ return (T) getShowInTargetList();
+
return super.getAdapter(adapter);
}
@@ -2089,6 +2094,29 @@ public abstract class AbstractDecoratedTextEditor extends StatusTextEditor {
}
/**
+ * Creates and returns the list of target part IDs for the Show In menu
+ *
+ * @return the 'Show In' target part IDs
+ * @since 3.13
+ */
+ protected String[] createShowInTargetList() {
+ return new String[] { IPageLayout.ID_MINIMAP_VIEW };
+ }
+
+ /**
+ * Returns the Show In target list
+ *
+ * @return the IShowInTargetList adapter, or <code>null</code> if no targets are listed
+ */
+ private IShowInTargetList getShowInTargetList() {
+ final String[] targetList= createShowInTargetList();
+ if (targetList != null && targetList.length > 0) {
+ return () -> targetList;
+ }
+ return null;
+ }
+
+ /**
* Returns the preference page ids of the preference pages to be shown when executing the
* preferences action from the editor context menu. The first page will be selected.
* <p>

Back to the top