<!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>
En konteksttype definerer en kontekst som maler blir evaluert i. En konteksttype bruker de tilhørende behandlerne til å behandle en mal.
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>
En malvariabelbehandler kan behandle en malvariabel i en bestemt kontekst.
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">
En mal er en snutt med kode eller tekst som blir evaluert i en gitt kontekst. Variabler som blir behandlet i den konteksten, kan oppgis ved hjelp av notasjonen ${variable_type}.
true
(standard) hvis malen skal være automatisk innsettbar, false
hvis automatisk innsetting ikke skal være tillatt. Siden 3.1.<!ELEMENT pattern (#PCDATA)>
Malmønsteret.
<!ELEMENT include EMPTY>
<!ATTLIST include
file CDATA #REQUIRED
translations CDATA #IMPLIED>
En samling med maler kodet som XML kan inkluderes som en helhet via dette elementet.
... translations=$nl$/[plugin-relativ bane til fil] ...Da må oversettelsene gå til:
[plugin-nl-fragment]/nl/[språkmiljø]/templates/[plugin-relativ bane til fil]
<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
i plugin-modulen org.eclipse.text.
org.eclipse.jface.text.templates
i plugin-modulen org.eclipse.text.
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