alias-for
속성 참조). 이 기능이 사용될 때,
<!ELEMENT extension (content-type* , file-association*)>
<!ATTLIST extension
point CDATA #REQUIRED
id CDATA #IMPLIED
name CDATA #IMPLIED>
<!ELEMENT content-type (describer? , property*)>
<!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
describer CDATA #IMPLIED
alias-for CDATA #IMPLIED>
<content-type>
<property name=
"org.eclipse.core.runtime.charset"
default=
"charset-name"
/>
</content-type>
<!ELEMENT describer (parameter*)>
<!ATTLIST describer
class CDATA #REQUIRED
plugin CDATA #IMPLIED>
설명자 속성이 content-type 요소에서 사용되면 이 요소는 무시됩니다.
<!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>
<!ELEMENT property EMPTY>
<!ATTLIST property
name CDATA #REQUIRED
default CDATA #IMPLIED>
이 컨텐츠 유형과 관련된 특성을 선언하며, 선택적으로 기본값을 지정합니다. 특성에 대한 자세한 정보는 org.eclipse.core.runtime.content.IContentDescription을 참조하십시오.
org.eclipse.core.runtime.content.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"
>
<parameter name=
"element"
value=
"abc"
/>
</describer>
</content-type>
</extension>
새 파일 이름/확장자를 기존 컨텐츠 유형에 연관시켜야 할 때(새 컨텐츠 유형 정의와는 반대로) 아래에 표시된 것처럼 플러그인에서는 파일 연관을 제공할 수 있습니다. 이것은 "*.mytxt" 패턴을 따르는 이름을 갖는 파일을 포함시키기 위해 텍스트 컨텐츠 유형의 정의를 향상시키는 효과를 갖습니다.<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>
<extension point=
"org.eclipse.core.runtime.contentTypes"
>
<content-type id=
"MyContentType"
file-extensions=
"dat"
>
<property name=
"file-format"
value=
"1"
/>
</content-type>
</extension>
org.eclipse.core.runtime 플러그인에서는 다음 컨텐츠 유형을 제공합니다.
또한 org.eclipse.core.runtime 플러그인에서는 컨텐츠 설명자의 사용 가능한 구현을 제공합니다.
Copyright (c) 2004, 2005 IBM Corporation and others.
All rights reserved. 본 프로그램 및 본 프로그램에 동봉되는 자료는 본 배포물에 동봉되는 Eclipse Public License v1.0의 조항에 따라 사용해야 하며
웹 사이트(http://www.eclipse.org/legal/epl-v10.html)에서도 관련 사항을 참조할 수 있습니다.