<!ELEMENT extension (content-type* , file-association*)>
<!ATTLIST extension
point CDATA #REQUIRED
id CDATA #IMPLIED
name CDATA #IMPLIED>
<!ELEMENT content-type (describer?)>
<!ATTLIST content-type
id CDATA #REQUIRED
base-type CDATA #IMPLIED
name CDATA #REQUIRED
file-extensions CDATA #IMPLIED
file-names CDATA #IMPLIED
priority (low|normal|high) "normal"
default-charset CDATA #IMPLIED>
<!ELEMENT describer (parameter*)>
<!ATTLIST describer
class CDATA #REQUIRED>
<!ELEMENT file-association EMPTY>
<!ATTLIST file-association
content-type CDATA #REQUIRED
file-names CDATA #IMPLIED
file-extensions CDATA #IMPLIED>
<!ELEMENT parameter EMPTY>
<!ATTLIST parameter
name CDATA #REQUIRED
value CDATA #REQUIRED>
XMLRootElementContentDescriber
(組み込みディスクライバー) を使用した XML ベースのコンテンツ型宣言の例を以下に示します。
特定のファイル拡張子を持つテキスト・ベースの単純なコンテンツ型の例を以下に示します。<extension point=
"org.eclipse.core.runtime.contentTypes"
>
<content-type id=
"ABC"
base-type=
"org.eclipse.core.runtime.xml"
file-extensions=
"a,b,c"
>
<describer class=
"org.eclipse.core.runtime.content.XMLRootElementContentDescriber"
>
<param name=
"element"
value=
"abc"
/>
</describer>
</content-type>
</extension>
上の例のような場合、既存のコンテンツ型に新規ファイル名/ファイル拡張子を関連付けるには、 通常、ファイルの関連付けのコントリビューションが最善の方法になります。<extension point=
"org.eclipse.core.runtime.contentTypes"
>
<content-type id=
"MyText"
base-type=
"org.eclipse.core.runtime.text"
file-extensions=
"mytxt"
/>
</extension>
<extension point=
"org.eclipse.core.runtime.contentTypes"
>
<file-association content-type=
"org.eclipse.core.runtime.text"
file-extensions=
"mytxt"
/>
</extension>
org.eclipse.core.runtime プラグインでは、 以下のコンテンツ型が提供されます。
また、org.eclipse.core.runtime プラグインでは、コンテンツ・ディスクライバーのすぐに使用可能な実装が提供されます。
Copyright (c) 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