<!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
autoinsert (true | false) "true">
テンプレートは、所定のコンテキストで評価されるコードまたはテキストの断片です このコンテキストで解決される変数は、${variable_type} 表記を使用して指定できます。
true
(デフォルト)。自動挿入を許可しない場合は false
。3.1 以降。<!ELEMENT pattern (#PCDATA)>
テンプレート・パターン。
<!ELEMENT include EMPTY>
<!ATTLIST include
file CDATA #REQUIRED
translations CDATA #IMPLIED>
XML としてエンコードされるテンプレートのコレクションは、このエレメントを使用して全体として組み込むことができます。
... translations=$nl$/[plugin-relative path to file] ...translation ファイルは、次の場所になります。
[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
パッケージを参照してください。
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