<!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>
コンテキスト型は、テンプレートを評価するコンテキストを定義します。 コンテキスト型では、テンプレートを解決するためにリゾルバーを使用します。
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>
テンプレート変数リゾルバーでは、特定のコンテキスト内でテンプレート変数を解決できます。
org.eclipse.jface.text.templates.TemplateVariableResolver
のサブクラス。<!ATTLIST template
id CDATA #REQUIRED
contextTypeId CDATA #REQUIRED
name CDATA #REQUIRED
description CDATA #IMPLIED
icon CDATA #IMPLIED>
テンプレートは、所定のコンテキストで評価されるコードまたはテキストの断片です このコンテキストで解決される変数は、${variable_type} 表記を使用して指定できます。
<!ELEMENT pattern (#CDATA)>
テンプレート・パターン。
<!ELEMENT include EMPTY>
<!ATTLIST include
file CDATA #REQUIRED
translations CDATA #IMPLIED>
XML としてエンコードされるテンプレートのコレクションは、このエレメントを使用して全体として組み込むことができます。
<extension point=
"org.eclipse.ui.examples.templateeditor.template"
>
<template name=
"javac"
context=
"ant"
editorId=
"org.eclipse.ui.examples.templateeditor.editors.TemplateEditor"
description=
"%ant.tasks.javac.description"
>
<pattern>
<javac srcdir=
"${src}"
destdir=
"${dst}"
classpath=
"${classpath}"
debug=
"${debug}"
/>
</pattern>
</template>
<resolver context=
"ant"
type=
"src"
editorId=
"org.eclipse.ui.examples.templateeditor.editors.TemplateEditor"
class=
"org.eclipse.ui.examples.templateeditor.editors.AntVariableResolver"
>
</resolver>
<resolver context=
"ant"
type=
"dst"
editorId=
"org.eclipse.ui.examples.templateeditor.editors.TemplateEditor"
class=
"org.eclipse.ui.examples.templateeditor.editors.AntVariableResolver"
>
</resolver>
</extension>
org.eclipse.jface.text.templates
パッケージを参照してください。
org.eclipse.jface.text.templates
パッケージを参照してください。
Copyright (c) 2001, 2004 IBM Corporation and others.
All rights reserved.
This program and the accompanying materials are made available under the terms of the Common Public License v1.0 which accompanies this distribution, and is available at http://www.eclipse.org/legal/cpl-v10.html