alias-for
attribute). When this feature is used:
<!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
file-patterns 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>
If the describer attribute is used in the content-type element, this element is ignored.
<!ELEMENT file-association EMPTY>
<!ATTLIST file-association
content-type IDREF #REQUIRED
file-names CDATA #IMPLIED
file-extensions CDATA #IMPLIED
file-patterns 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.
org.eclipse.core.runtime.content.XMLRootElementContentDescriber2
,
a built-in describer:
<extension point="org.eclipse.core.contenttype.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.contenttype.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.contenttype.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.contenttype.contentTypes"> <content-type id="MyContentType" file-extensions="dat"> <property name="file-format" value="1"/> </content-type> </extension>
The org.eclipse.core.contenttype plug-in provides the following content types:
Also, the org.eclipse.core.contenttype plug-in provides ready-to-use implementations of content describers:
Copyright (c) 2004, 2008 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