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

schema.templates.exsd Maven / Gradle / Ivy

The newest version!




      
         
      
      
         Templates are snippets of text or code which help the user enter reoccurring patterns into a text editor. Templates may contain variables which are resolved in the context where the template is inserted.
      
   

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

   
      
         
            
         
         
            A context type defines a context within which templates are evaluated. A context type uses its resolvers to resolve a template.
         
      
      
         
            
               
                  unambiguously identifies this context type. Use of a qualified name is recommended.
               
            
         
         
            
               
                  a subclass of <code>org.eclipse.jface.text.templates.TemplateContextType</code>
               
               
                  
               
            
         
         
            
               
                  the display name of this context
               
               
                  
               
            
         
         
            
               
                  the id of the context type registry where this context type is automatically registered. Since 3.5.
               
               
                  
               
            
         
      
   

   
      
         
            
         
         
            A template variable resolver can resolve a template variable in a certain context.
         
      
      
         
            
               
                  references the context type that this resolver is contributed to
               
               
                  
               
            
         
         
            
               
                  the type of this variable resolver. This property will be set on the resolver once it gets created.
               
            
         
         
            
               
                  a subclass of <code>org.eclipse.jface.text.templates.TemplateVariableResolver</code>
               
               
                  
               
            
         
         
            
               
                  the description of this variable resolver. This property will be set on the resolver once it gets created.
               
               
                  
               
            
         
         
            
               
                  the display name of this resolver
               
               
                  
               
            
         
         
            
               
                  an icon that may be displayed in the user interface
               
               
                  
               
            
         
      
   

   
      
         
            
         
         
            A template is a snippet of code or text that will be evaluated in a given context. Variables which will be resolved in that context can be specified using the <tt>${variable_type}</tt> notation.
         
      
      
         
            
         
         
            
               
                  unambiguously identifies this template. Use of a qualified name is recommended.
               
            
         
         
            
               
                  references the context type that this template is contributed to
               
               
                  
               
            
         
         
            
               
                  the internationalizable name of the template which will show up in the UI, such as in template proposals
               
               
                  
               
            
         
         
            
               
                  the description of this template
               
               
                  
               
            
         
         
            
               
                  an icon that may be displayed in the UI for this template, for example in content assist proposals
               
               
                  
               
            
         
         
            
               
                  <code>true</code> (default) to make the template automatically insertable, <code>false</code> to not allow automatic insertion. Since 3.1.
               
            
         
      
   

   
      
         
            The template pattern.
         
      
   

   
      
         
            A collection of templates encoded as XML can be included as a whole via this element.
         
      
      
         
            
               
                  the XML file to import templates from. It defines at least one &lt;template&gt; element inside &lt;templates&gt;...&lt;/templates&gt;, with the following attributes:
<ul>
	<li>id - the uniqe id</li>
	<li>name - the name</li>
	<li>context - the context id</li>
	<li>description - the description (optional, default: "")</li>
	<li>autoinsert (optional, default: true)</li>
	<li>enabled (optional, default: true)</li>
</ul>
See above template element for more details about those attributes.
               
               
                  
               
            
         
         
            
               
                  an optional properties file with resources for the templates specified in <tt>file</tt>.
<br>
<em>Note:</em> The translation files are not treated as resource bundles and hence the file name has to be left as is i.e. do not add the  locale to the file name. The translated files must be in the 'nl' directory i.e. if a [plugin] defines a template translations file in its plugin.xml like:
<pre>
...
  translations=$nl$/[plugin-relative path to file]
...
</pre>
then the translations must go into:
<pre>
  [plugins nl fragment]/nl/[locale]/templates/[plugin-relative path to file]
</pre>
               
               
                  
               
            
         
      
   

   
      
         
            Defines a registry for context types. Context types which define a 'registryId' are automatically added to the registry which is created by <code>new org.eclipse.ui.editors.text.templates.ContributionContextTypeRegistry(registryId)</code>. Since 3.5.
         
      
      
         
            
               
                  the id of this registry
               
            
         
      
   

   
      
         
      
      
         3.0
      
   

   
      
         
      
      
         <pre>
   <extension
         point="org.eclipse.ui.editors.templates">
      <template
         name="%ant.tasks.javac.name"
         contextTypeId="org.eclipse.ui.examples.templateeditor.antcontext"
         id="org.eclipse.ui.examples.templateeditor.templates.javac"
         description="%ant.tasks.javac.description">
          <pattern>
             <javac srcdir="${src}"
               destdir="${dst}"
               classpath="${classpath}"
               debug="${debug}"/>
          </pattern>
      </template>
      
      <resolver
         contextTypeId="org.eclipse.ui.examples.templateeditor.antcontext"
         type="src"
         class="org.eclipse.ui.examples.templateeditor.editors.AntVariableResolver">
      </resolver>
      
      <resolver
         contextTypeId="org.eclipse.ui.examples.templateeditor.antcontext"
         type="dst"
         class="org.eclipse.ui.examples.templateeditor.editors.AntVariableResolver">
      </resolver>
   </extension>
</pre>
      
   

   
      
         
      
      
         See the <code>org.eclipse.jface.text.templates</code> package in the <tt>org.eclipse.text</tt> plug-in for the relevant API.
      
   

   
      
         
      
      
         See the <code>org.eclipse.jface.text.templates</code> package in the <tt>org.eclipse.text</tt> plug-in for the relevant classes.
      
   

   
      
         
      
      
         Copyright (c) 2001, 2010 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 - 2025 Weber Informatics LLC | Privacy Policy