All Downloads are FREE. Search and download functionalities are using the official Maven repository.

schema.contentTypes.exsd Maven / Gradle / Ivy

The newest version!




      
         
      
      
         The content types extension point allows plug-ins to contribute to the platform content type catalog. There are two forms of contributions: <cite>content types</cite> and <cite>file associations</cite>.
<ul>
<li>
a content type represents a file format and its naming conventions. Content types can be defined from scratch, or can inherit from existing ones, specializing them. Also, a content type can be made into an alias for another content type (see the <code>alias-for</code> attribute). When this feature is used:
  <ul><li>if the target is absent, the alias content type is processed 
  as a normal content type;</li>
  <li>if the target is present, all references to the alias type are automatically
  transformed into references to the target type, and the alias type cannot be 
  accessed nor is exposed through the API.</li></ul>
</li>
<li>
a file association extends an existing content type by associating new file names and/or extensions to it</li>
</ul>
      
   

   
      
         
            
         
      
      
         
            
            
         
         
            
               
                  a fully qualified identifier of the target extension point
               
            
         
         
            
               
                  an optional identifier of the extension instance
               
            
         
         
            
               
                  an optional name of the extension instance
               
               
                  
               
            
         
      
   

   
      
         
            
            
         
         
            
               
                  the identifier for this content type (either a simple id unique for content types within the extension namespace, or a fully qualified id). The token cannot contain whitespace
               
            
         
         
            
               
                  the fully qualified identifier of this content type's base type. This content type will inherit its base type's file associations, content describer and default charset, unless they are redefined
               
            
         
         
            
               
                  the human-readable name of this content type
               
               
                  
               
            
         
         
            
               
                  a comma-separated list of file extensions to be associated with this content type
               
            
         
         
            
               
                  a comma-separated list of file names to be associated with this content type
               
            
         
         
            
               
                  the priority for this content type. Priorities are used to solve conflicts (when two content types are associated to the same file name/extension)
               
            
            
               
                  
                  
                  
                  
                  
                  
               
            
         
         
            
               
                  the default charset for this content type, or an empty string, if this content type should not have a default charset even if the parent has one. This is a convenience attribute, equivalent to specifying:
<pre>
  <content-type>
    <property name="org.eclipse.core.runtime.charset" default="charset-name"/>
  </content-type>
</pre>
               
            
         
         
            
               
                  the fully qualified name of a class that implements <samp>org.eclipse.core.runtime.content.IContentDescriber</samp> or <samp>org.eclipse.core.runtime.content.ITextContentDescriber</samp>, or an empty string, if this content type should not have a describer even if the parent has one
               
               
                  
               
            
         
         
            
               
                  the fully qualified identifier of the content type this content type is an alias for
               
            
         
      
   

   
      
         
            If the describer attribute is used in the content-type element, this element is ignored.
         
      
      
         
            
         
         
            
               
                  the fully qualified name of a class that implements <samp>org.eclipse.core.runtime.content.IContentDescriber</samp> or <samp>org.eclipse.core.runtime.content.ITextContentDescriber</samp>, or an empty string, if this content type should not have a describer even if the parent has one
               
               
                  
               
            
         
         
            
               
                  the id for the plug-in providing the describer class
               
            
         
      
   

   
      
         
            
               
                  the fully qualified identifier for the content type this file association contributes to
               
            
         
         
            
               
                  a comma-separated list of file names to be associated with the target content type
               
            
         
         
            
               
                  a comma-separated list of file extensions to be associated with the target content type
               
            
         
      
   

   
      
         
            
               
                  the name of this parameter made available to instances of the specified content describer class
               
            
         
         
            
               
                  an arbitrary value associated with the given name and made available to instances of the specified content describer class
               
            
         
      
   

   
      
         
            Declares a property related to this content type, optionally assigning a default value. See <samp>org.eclipse.core.runtime.content.IContentDescription</samp> for more information on properties.
         
      
      
         
            
               
                  the name of the property. If the property is being overriden and has been originally defined in a different namespace, a fully qualified property name must be used
               
            
         
         
            
               
                  the default value of the property, or an empty string, if this content type should not have a default value for this property even if a parent has one
               
            
         
      
   

   
      
         
      
      
         3.0
      
   

   
      
         
      
      
         Following is an example of a XML-based content type declaration using <code>org.eclipse.core.runtime.content.XMLRootElementContentDescriber2</code>, 
a built-in describer: 
<p>
<pre>
   <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> 
</pre>
</p>
Here is an example of a simple text-based content type that has a specific file extension:
<p>
<pre>
   <extension point="org.eclipse.core.runtime.contentTypes"> 
      <content-type id="MyText"
       base-type="org.eclipse.core.runtime.text"
       file-extensions="mytxt"/>
   </extension> 
</pre>
</p>
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.
<p>
<pre>
   <extension point="org.eclipse.core.runtime.contentTypes"> 
      <file-association 
       content-type="org.eclipse.core.runtime.text"
       file-extensions="mytxt"/>
   </extension> 
</pre>
</p>
Here is an example of a content type that defines properties:
<pre>
   <extension point="org.eclipse.core.runtime.contentTypes"> 
      <content-type id="MyContentType"
       file-extensions="dat">
         <property name="file-format" value="1"/>
      </content-type>
   </extension> 
</pre>
</p>
      
   

   
      
         
      
      
         The value of the class attribute in the describer element must represent an 
implementor of 
<samp>org.eclipse.core.runtime.content.IContentDescriber</samp> or <samp>org.eclipse.core.runtime.content.ITextContentDescriber</samp>.

<samp>org.eclipse.core.runtime.content.IContentDescription</samp> objects returned by the <samp>org.eclipse.core.runtime.content</samp> API
      
   

   
      
         
      
      
         <p>The org.eclipse.core.runtime plug-in provides the following content types:<ul>
<li>org.eclipse.core.runtime.text</li>
<li>org.eclipse.core.runtime.xml</li>
</ul>
Other plug-ins in the platform contribute other content types.
</p>
<p>
Also, the org.eclipse.core.runtime plug-in provides ready-to-use implementations of content describers:<ul>
<li>org.eclipse.core.runtime.content.XMLRootElementContentDescriber2</li>
<li>org.eclipse.core.runtime.content.BinarySignatureDescriber</li>
</ul>
</p>
      
   

   
      
         
      
      
         Copyright (c) 2004, 2008 IBM Corporation and others.<br>
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 
<a 
href="http://www.eclipse.org/legal/epl-v10.html">http://www.eclipse.org/legal/epl-v10.html</a>
      
   






© 2015 - 2024 Weber Informatics LLC | Privacy Policy