<!ELEMENT extension (template* , resolver* , contextType* , include* , contextTypeRegistry*)>
<!ATTLIST extension
point CDATA #REQUIRED
id CDATA #IMPLIED
name CDATA #IMPLIED>
<!ELEMENT contextType EMPTY>
<!ATTLIST contextType
id CDATA #REQUIRED
class CDATA #REQUIRED
name CDATA #IMPLIED
registryId IDREF #IMPLIED>
A context type defines a context within which templates are evaluated. A context type uses its resolvers to resolve a template.
org.eclipse.jface.text.templates.TemplateContextType
<!ELEMENT resolver EMPTY>
<!ATTLIST resolver
contextTypeId IDREF #REQUIRED
type CDATA #REQUIRED
class CDATA #REQUIRED
description CDATA #IMPLIED
name CDATA #IMPLIED
icon CDATA #IMPLIED>
A template variable resolver can resolve a template variable in a certain context.
org.eclipse.jface.text.templates.TemplateVariableResolver
<!ATTLIST template
id CDATA #REQUIRED
contextTypeId IDREF #REQUIRED
name CDATA #REQUIRED
description CDATA #IMPLIED
icon CDATA #IMPLIED
autoinsert (true | false) "true">
A template is a snippet of code or text that will be evaluated in a given context. Variables which will be resolved in that context can be specified using the ${variable_type} notation.
true
(default) to make the template automatically insertable, false
to not allow automatic insertion. Since 3.1.<!ELEMENT pattern (#PCDATA)>
The template pattern.
<!ELEMENT include EMPTY>
<!ATTLIST include
file CDATA #REQUIRED
translations CDATA #IMPLIED>
A collection of templates encoded as XML can be included as a whole via this element.
...
translations=$nl$/[plugin-relative path to file]
...
then the translations must go into:
[plugins nl fragment]/nl/[locale]/templates/[plugin-relative path to file]
<!ELEMENT contextTypeRegistry EMPTY>
<!ATTLIST contextTypeRegistry
id CDATA #IMPLIED>
Defines a registry for context types. Context types which define a 'registryId' are automatically added to the registry which is created by new org.eclipse.ui.editors.text.templates.ContributionContextTypeRegistry(registryId)
. Since 3.5.
<extension point="org.eclipse.ui.editors.templates"> <template name="%ant.tasks.javac.name" contextTypeId="org.eclipse.ui.examples.templateeditor.antcontext" id="org.eclipse.ui.examples.templateeditor.templates.javac" description="%ant.tasks.javac.description"> <pattern> <javac srcdir="${src}" destdir="${dst}" classpath="${classpath}" debug="${debug}"/> </pattern> </template> <resolver contextTypeId="org.eclipse.ui.examples.templateeditor.antcontext" type="src" class="org.eclipse.ui.examples.templateeditor.editors.AntVariableResolver"> </resolver> <resolver contextTypeId="org.eclipse.ui.examples.templateeditor.antcontext" type="dst" class="org.eclipse.ui.examples.templateeditor.editors.AntVariableResolver"> </resolver> </extension>
org.eclipse.jface.text.templates
package in the org.eclipse.text plug-in for the relevant API.
org.eclipse.jface.text.templates
package in the org.eclipse.text plug-in for the relevant classes.
Copyright (c) 2001, 2010 IBM Corporation and others.
This program and the accompanying materials are made available under the terms of the Eclipse Public License 2.0 which accompanies this distribution, and is available at https://www.eclipse.org/legal/epl-v20.html/
SPDX-License-Identifier: EPL-2.0