Skip to content

Commit

Permalink
Use "Generic Text Editor" with own icon instead of separate editors
Browse files Browse the repository at this point in the history
  • Loading branch information
howlger committed Apr 28, 2022
1 parent b72a8cd commit bb38a31
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 15 deletions.
7 changes: 7 additions & 0 deletions de.agilantis.language_pack/plugin.xml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,13 @@
priority="low"/>
</extension>

<!-- use "Generic Text Editor" -->
<extension point="org.eclipse.ui.editors">
<editorContentTypeBinding
contentTypeId="de.agilantis.language_pack.basetype"
editorId="org.eclipse.ui.genericeditor.GenericEditor"/>
</extension>

<!-- INSERT SNIPPETS HERE -->

</plugin>
18 changes: 3 additions & 15 deletions transform_to_plugin_snippet.xsl
Original file line number Diff line number Diff line change
Expand Up @@ -111,22 +111,10 @@
</extension>
</xsl:if>

<!-- editors -->
<extension point="org.eclipse.ui.genericeditor.presentationReconcilers">
<!-- editor icons -->
<extension point="org.eclipse.ui.genericeditor.icons">
<xsl:for-each select="exsl:node-set($languages)/o">
<presentationReconciler class="org.eclipse.tm4e.ui.text.TMPresentationReconciler"
contentType="lng.{e[@name='id']/@string}"/>
</xsl:for-each>
</extension>
<extension point="org.eclipse.ui.editors">
<xsl:for-each select="exsl:node-set($languages)/o">
<editor id="lngeditor.{e[@name='id']/@string}"
name="{a[@name='aliases']/v[1]/@string} Editor (Syntax Highlighting)"
icon="lngeditor.png"
class="org.eclipse.ui.internal.genericeditor.ExtensionBasedTextEditor"
contributorClass="org.eclipse.ui.editors.text.TextEditorActionContributor">
<contentTypeBinding contentTypeId="lng.{e[@name='id']/@string}"/>
</editor>
<icon contentType="lng.{e[@name='id']/@string}" icon="lngeditor.png"/>
</xsl:for-each>
</extension>

Expand Down

0 comments on commit bb38a31

Please sign in to comment.