<!ELEMENT extension (template* , resolver* , contextType* , include*)>
<!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>
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 CDATA #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 CDATA #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]
<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, 2005 IBM Corporation and others.
All rights reserved. This program and the accompanying materials are made available under the terms of the Eclipse Public License v1.0 which accompanies this distribution, and is available at http://www.eclipse.org/legal/epl-v10.html