Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSimon Scholz2017-11-30 08:12:20 -0500
committerAlexander Kurtakov2018-01-17 15:45:55 -0500
commit5a70447e138b628397ae69d1a379abc6e88b9a8d (patch)
tree725f163b52449de52b6248fb4e46a04e31b431c7
parent0d7ba04e9f7234bd06246884dcfff974339722b7 (diff)
downloadeclipse.platform.text-5a70447e138b628397ae69d1a379abc6e88b9a8d.tar.gz
eclipse.platform.text-5a70447e138b628397ae69d1a379abc6e88b9a8d.tar.xz
eclipse.platform.text-5a70447e138b628397ae69d1a379abc6e88b9a8d.zip
Bug 527830 - [GenericEditor] hyperlinkDetectorTargetM20180125-0335M20180124-0610M20180124-0400
Add a hyperlinkDetectorTarget for the generic editor Change-Id: I32c2d0e3d9fc35eef469252dca17d8a9f633d30f Signed-off-by: Simon Scholz <simon.scholz@vogella.com>
-rw-r--r--org.eclipse.ui.genericeditor/plugin.properties1
-rw-r--r--org.eclipse.ui.genericeditor/plugin.xml11
-rw-r--r--org.eclipse.ui.genericeditor/src/org/eclipse/ui/internal/genericeditor/ExtensionBasedTextViewerConfiguration.java9
3 files changed, 20 insertions, 1 deletions
diff --git a/org.eclipse.ui.genericeditor/plugin.properties b/org.eclipse.ui.genericeditor/plugin.properties
index 069cba3b2..6ee5867db 100644
--- a/org.eclipse.ui.genericeditor/plugin.properties
+++ b/org.eclipse.ui.genericeditor/plugin.properties
@@ -12,6 +12,7 @@ genericEditor_name=Generic Text Editor
ExtPoint.presentationReconciliers=Presentation Reconciliers
ExtPoint.hoverProviders= Hover Providers
ExtPoint.contentAssistProcessors=Content Assist Providers
+ExtPoint.hyperlinkDetectorTarget=Generic Text Editor
openDeclarationCommand_name=Open Declaration
context_name=in Generic Code Editor
context_description=When editing in the Generic Code Editor
diff --git a/org.eclipse.ui.genericeditor/plugin.xml b/org.eclipse.ui.genericeditor/plugin.xml
index 06b6de70d..739ea8ad3 100644
--- a/org.eclipse.ui.genericeditor/plugin.xml
+++ b/org.eclipse.ui.genericeditor/plugin.xml
@@ -87,5 +87,14 @@
id="org.eclipse.ui.genericeditor.annotationsHoverProvider">
</hoverProvider>
</extension>
-
+ <extension
+ point="org.eclipse.ui.workbench.texteditor.hyperlinkDetectorTargets">
+ <target
+ id="org.eclipse.ui.genericeditor.GenericEditor"
+ name="%ExtPoint.hyperlinkDetectorTarget">
+ <context
+ type="org.eclipse.ui.texteditor.ITextEditor">
+ </context>
+ </target>
+ </extension>
</plugin>
diff --git a/org.eclipse.ui.genericeditor/src/org/eclipse/ui/internal/genericeditor/ExtensionBasedTextViewerConfiguration.java b/org.eclipse.ui.genericeditor/src/org/eclipse/ui/internal/genericeditor/ExtensionBasedTextViewerConfiguration.java
index 0992d1460..42bcd7990 100644
--- a/org.eclipse.ui.genericeditor/src/org/eclipse/ui/internal/genericeditor/ExtensionBasedTextViewerConfiguration.java
+++ b/org.eclipse.ui.genericeditor/src/org/eclipse/ui/internal/genericeditor/ExtensionBasedTextViewerConfiguration.java
@@ -14,9 +14,11 @@ import java.util.Arrays;
import java.util.LinkedHashSet;
import java.util.LinkedList;
import java.util.List;
+import java.util.Map;
import java.util.Queue;
import java.util.Set;
+import org.eclipse.core.runtime.IAdaptable;
import org.eclipse.core.runtime.Platform;
import org.eclipse.core.runtime.content.IContentType;
import org.eclipse.jface.preference.IPreferenceStore;
@@ -188,4 +190,11 @@ public final class ExtensionBasedTextViewerConfiguration extends TextSourceViewe
public IReconciler getReconciler(ISourceViewer sourceViewer) {
return null; // to disable spell-checker
}
+
+ @Override
+ protected Map<String, IAdaptable> getHyperlinkDetectorTargets(ISourceViewer sourceViewer) {
+ Map<String, IAdaptable> targets= super.getHyperlinkDetectorTargets(sourceViewer);
+ targets.put("org.eclipse.ui.genericeditor.GenericEditor", editor); //$NON-NLS-1$
+ return targets;
+ }
}

Back to the top