Hello,
I am working on a plugin myplugin that supports a custom webproject and perspective.
XHTML, CSS en .JS have an adapted syntax.
Code templates need to be provided that must be stored in the plugin in templates/templates.xml.
In templates.xml resides:
<templates>
<template autoinsert="true"
contextTypeId="html_tag"
description="[Description]"
id="org.eclipse.jst.jsf.ui.newHtmltag"
name="testTag"
enabled="true"
context="html_tag" >
Some template content...
</template>
</templates>
In plugin.xml we have:
<extension
point="org.eclipse.ui.editors.templates">
<include file="templates/templates.xml"/>
</extension>
This template does indeed show up in Preferences > Web > HTML files > Editor > Templates under context=HTML Tag.
What I do not understand is: how can I introduce a new HTML context 'CE_HTML' where my new templates will reside under? Changes/additions allowed only in myplugin.
I tried this in plugin.xml:
<!-- Templates -->
<extension point="org.eclipse.ui.editors.templates">
<contextType
name="%CE_HTML_context_type_Extension_Element.name"
class="org.eclipse.wst.html.ui.internal.templates.TemplateContextTypeHTML"
id="html_ce">
</contextType>
<include
file="templates/htmldefault-templates2.xml"
translations="$nl$/templates/htmldefault-templates.properties">
</include>
</extension>
with templates in htmldefault-templates2.xml but nothing shows up.
Any suggestion would be much appreciated.