Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSimon Scholz2017-11-27 18:11:41 -0500
committerMickael Istria2017-11-28 04:22:24 -0500
commit9eebfa376eeadd862a2ecd0ad941ef1a4dbda834 (patch)
treefc3e62a80ea437ef7888d62b3d4b3d047f9b781a /org.eclipse.ui.genericeditor
parent2592611ebda83d3b2388eea8eea8bac3c83babaf (diff)
downloadeclipse.platform.text-9eebfa376eeadd862a2ecd0ad941ef1a4dbda834.tar.gz
eclipse.platform.text-9eebfa376eeadd862a2ecd0ad941ef1a4dbda834.tar.xz
eclipse.platform.text-9eebfa376eeadd862a2ecd0ad941ef1a4dbda834.zip
Bug 527830 - [GenericEditor] hyperlinkDetectorTarget
Add a hyperlinkDetectorTarget for the generic editor Change-Id: I79c0d33e247d26daa6f24618cec84701c9dc91b1 Signed-off-by: Simon Scholz <simon.scholz@vogella.com>
Diffstat (limited to 'org.eclipse.ui.genericeditor')
-rw-r--r--org.eclipse.ui.genericeditor/plugin.properties2
-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, 22 insertions, 0 deletions
diff --git a/org.eclipse.ui.genericeditor/plugin.properties b/org.eclipse.ui.genericeditor/plugin.properties
index 4905b4f67..725ae4c04 100644
--- a/org.eclipse.ui.genericeditor/plugin.properties
+++ b/org.eclipse.ui.genericeditor/plugin.properties
@@ -9,6 +9,7 @@
# Sopot Cela & Mickael Istria (Red Hat Inc.) - initial implementation
# Lucas Bullen (Red Hat Inc.) - Bug 508829 custom reconciler support
# - Bug 521382 default highlighter
+# Simon Scholz <simon.scholz@vogella.com> - Bug 527830
###############################################################################
genericEditor_name=Generic Text Editor
ExtPoint.reconciliers=Reconciliers
@@ -17,6 +18,7 @@ ExtPoint.hoverProviders= Hover Providers
ExtPoint.contentAssistProcessors=Content Assist Providers
ExtPoint.autoEditStrategies=Auto Edit Strategies
ExtPoint.highlightReconcilers=Highlight Reconcilers
+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 f7098c917..1bda8959e 100644
--- a/org.eclipse.ui.genericeditor/plugin.xml
+++ b/org.eclipse.ui.genericeditor/plugin.xml
@@ -11,6 +11,7 @@
<!-- Sopot Cela & Mickael Istria (Red Hat Inc). -initial implementation -->
<!-- Lucas Bullen (Red Hat Inc.) - Bug 508829 custom reconciler support -->
<!-- - Bug 521382 default highlighter -->
+<!-- Simon Scholz <simon.scholz@vogella.com> - Bug 527830 -->
<!-- ====================================================================== -->
<plugin>
<extension-point id="reconcilers" name="%ExtPoint.reconciliers" schema="schema/reconcilers.exsd"/>
@@ -153,4 +154,14 @@
</themeid>
</stylesheet>
</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 be79f1f6f..3b39a9e40 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
@@ -9,6 +9,7 @@
* Sopot Cela, Mickael Istria (Red Hat Inc.) - initial implementation
* Lucas Bullen (Red Hat Inc.) - Bug 508829 custom reconciler support
* - Bug 521382 default highlight reconciler
+ * Simon Scholz <simon.scholz@vogella.com> - Bug 527830
*******************************************************************************/
package org.eclipse.ui.internal.genericeditor;
@@ -16,9 +17,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;
@@ -213,4 +216,10 @@ public final class ExtensionBasedTextViewerConfiguration extends TextSourceViewe
return super.getAutoEditStrategies(sourceViewer, contentType);
}
+ @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