Content Types

This extension point is deprecated, use org.eclipse.core.contenttype.contentTypes as a replacement.

Identifier:
org.eclipse.core.runtime.contentTypes

Since:
3.0

Description:

WARNING: This extension point is DEPRECATED.
Do not use this extension point, it will be removed in future versions of this product. Instead, use the extension point org.eclipse.core.contenttype.contentTypes

The content types extension point allows plug-ins to contribute to the platform content type catalog. There are two forms of contributions: content types and file associations.

Configuration Markup:

<!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>


<!ELEMENT describer (parameter*)>

<!ATTLIST describer

class  CDATA #REQUIRED

plugin CDATA #IMPLIED>

If the describer attribute is used in the content-type element, this element is ignored.



<!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>

Declares a property related to this content type, optionally assigning a default value. See org.eclipse.core.runtime.content.IContentDescription for more information on properties.



Examples:
Following is an example of an XML-based content type declaration using org.eclipse.core.runtime.content.XMLRootElementContentDescriber2, a built-in describer:


   <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.XMLRootElementContentDescriber2">
        <parameter name="element" value="abc"/>
       </describer>
      </content-type> 
   </extension> 

Here is an example of a simple text-based content type that has a specific file extension:


   <extension point="org.eclipse.core.runtime.contentTypes"> 
      <content-type id="MyText"
       base-type="org.eclipse.core.runtime.text"
       file-extensions="mytxt"/>
   </extension> 

When there is need to associate new file names/extensions to an existing content type (as opposed to defining a new content type), a plug-in can contribute a file association as seen below. This has the effect of enhancing the definition of the text content type to include files with names following the "*.mytxt" pattern.


   <extension point="org.eclipse.core.runtime.contentTypes"> 
      <file-association 
       content-type="org.eclipse.core.runtime.text"
       file-extensions="mytxt"/>
   </extension> 

Here is an example of a content type that defines properties:

   <extension point="org.eclipse.core.runtime.contentTypes"> 
      <content-type id="MyContentType"
       file-extensions="dat">
         <property name="file-format" value="1"/>
      </content-type>
   </extension> 

API Information:
The value of the class attribute in the describer element must represent an implementor of org.eclipse.core.runtime.content.IContentDescriber or org.eclipse.core.runtime.content.ITextContentDescriber. org.eclipse.core.runtime.content.IContentDescription objects returned by the org.eclipse.core.runtime.content API

Supplied Implementation:

The org.eclipse.core.runtime plug-in provides the following content types:

Other plug-ins in the platform contribute other content types.

Also, the org.eclipse.core.runtime plug-in provides ready-to-use implementations of content describers:


Copyright (c) 2004, 2019 IBM Corporation and others.
This program and the accompanying materials are made available under the terms of the Eclipse Public License 2.0 which accompanies this distribution, and is available at https://www.eclipse.org/legal/epl-v20.html/ SPDX-License-Identifier: EPL-2.0