<!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>
Kontekstilaji (contextType) määrittää, missä mallipohjia käytetään. Kontekstilaji selvittää mallipohjan selvitystoimintojensa avulla.
org.eclipse.jface.text.templates.TemplateContextType
-luokan aliluokka.<!ELEMENT resolver EMPTY>
<!ATTLIST resolver
contextTypeId CDATA #REQUIRED
type CDATA #REQUIRED
class CDATA #REQUIRED
description CDATA #IMPLIED
name CDATA #IMPLIED
icon CDATA #IMPLIED>
Mallipohjan muuttujien selvitystoiminto voi selvittää tietyssä yhteydessä käytettävän mallipohjan muuttujan.
org.eclipse.jface.text.templates.TemplateVariableResolver
-luokan aliluokka.<!ATTLIST template
id CDATA #REQUIRED
contextTypeId CDATA #REQUIRED
name CDATA #REQUIRED
description CDATA #IMPLIED
icon CDATA #IMPLIED
autoinsert (true | false) "true">
Mallipohja on koodi- tai tekstikatkelma, jonka sisältö määräytyy käyttöyhteyden (kontekstin) mukaan. Kontekstin mukaan määräytyvät muuttujat määritetään muodossa ${muuttujan_laji}.
true
(oletusarvo), mallipohja lisätään automaattisesti. Jos arvo on false
, automaattista lisäystä ei sallita. Käytössä versiosta 3.1 alkaen.<!ELEMENT pattern (#PCDATA)>
Tämä elementti määrittää mallipohjan kaavan.
<!ELEMENT include EMPTY>
<!ATTLIST include
file CDATA #REQUIRED
translations CDATA #IMPLIED>
Tämän elementin avulla voi lisätä kokonaisen XML-koodatun mallipohjakokoelman.
... käännökset=$nl$/[lisäosan suhteellinen tiedostopolku] ...käännökset on sijoitettava seuraavaanlaiseen sijaintiin:
[lisäosat nl-fragmentti]/nl/[paikallistunnus]/mallipohjat/[lisäosan suhteellinen tiedostopolku]
<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
.
org.eclipse.jface.text.templates
.
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