Skip to main content
aboutsummaryrefslogtreecommitdiffstats
blob: 9e5ce91bdfa8adbf444f5927004b8384b07bc198 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
<?xml version='1.0' encoding='UTF-8'?>
<!-- Schema file written by PDE -->
<schema targetNamespace="org.eclipse.ui.editors" xmlns="http://www.w3.org/2001/XMLSchema">
<annotation>
      <appInfo>
         <meta.schema plugin="org.eclipse.ui.editors" id="templates" name="Editor Template"/>
      </appInfo>
      <documentation>
         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.
      </documentation>
   </annotation>

   <element name="extension">
      <annotation>
         <appInfo>
            <meta.element labelAttribute="name" />
         </appInfo>
      </annotation>
      <complexType>
         <sequence>
            <element ref="template" minOccurs="0" maxOccurs="unbounded"/>
            <element ref="resolver" minOccurs="0" maxOccurs="unbounded"/>
            <element ref="contextType" minOccurs="0" maxOccurs="unbounded"/>
            <element ref="include" minOccurs="0" maxOccurs="unbounded"/>
            <element ref="contextTypeRegistry" minOccurs="0" maxOccurs="unbounded"/>
         </sequence>
         <attribute name="point" type="string" use="required">
            <annotation>
               <documentation>
                  a fully qualified identifier of the target extension point
               </documentation>
            </annotation>
         </attribute>
         <attribute name="id" type="string">
            <annotation>
               <documentation>
                  an optional identifier of the extension instance
               </documentation>
            </annotation>
         </attribute>
         <attribute name="name" type="string">
            <annotation>
               <documentation>
                  an optional name of the extension instance
               </documentation>
               <appInfo>
                  <meta.attribute translatable="true"/>
               </appInfo>
            </annotation>
         </attribute>
      </complexType>
   </element>

   <element name="contextType">
      <annotation>
         <appInfo>
            <meta.element labelAttribute="name"/>
         </appInfo>
         <documentation>
            A context type defines a context within which templates are evaluated. A context type uses its resolvers to resolve a template.
         </documentation>
      </annotation>
      <complexType>
         <attribute name="id" type="string" use="required">
            <annotation>
               <documentation>
                  unambiguously identifies this context type. Use of a qualified name is recommended.
               </documentation>
            </annotation>
         </attribute>
         <attribute name="class" type="string" use="required">
            <annotation>
               <documentation>
                  a subclass of &lt;code&gt;org.eclipse.jface.text.templates.TemplateContextType&lt;/code&gt;
               </documentation>
               <appInfo>
                  <meta.attribute kind="java" basedOn="org.eclipse.jface.text.templates.TemplateContextType"/>
               </appInfo>
            </annotation>
         </attribute>
         <attribute name="name" type="string">
            <annotation>
               <documentation>
                  the display name of this context
               </documentation>
               <appInfo>
                  <meta.attribute translatable="true"/>
               </appInfo>
            </annotation>
         </attribute>
         <attribute name="registryId" type="string">
            <annotation>
               <documentation>
                  the id of the context type registry where this context type is automatically registered. Since 3.5.
               </documentation>
               <appInfo>
                  <meta.attribute kind="identifier" basedOn="org.eclipse.ui.editors.templates/contextTypeRegistry/@id"/>
               </appInfo>
            </annotation>
         </attribute>
      </complexType>
   </element>

   <element name="resolver">
      <annotation>
         <appInfo>
            <meta.element labelAttribute="name" icon="icon"/>
         </appInfo>
         <documentation>
            A template variable resolver can resolve a template variable in a certain context.
         </documentation>
      </annotation>
      <complexType>
         <attribute name="contextTypeId" type="string" use="required">
            <annotation>
               <documentation>
                  references the context type that this resolver is contributed to
               </documentation>
               <appInfo>
                  <meta.attribute kind="identifier" basedOn="org.eclipse.ui.editors.templates/contextType/@id"/>
               </appInfo>
            </annotation>
         </attribute>
         <attribute name="type" type="string" use="required">
            <annotation>
               <documentation>
                  the type of this variable resolver. This property will be set on the resolver once it gets created.
               </documentation>
            </annotation>
         </attribute>
         <attribute name="class" type="string" use="required">
            <annotation>
               <documentation>
                  a subclass of &lt;code&gt;org.eclipse.jface.text.templates.TemplateVariableResolver&lt;/code&gt;
               </documentation>
               <appInfo>
                  <meta.attribute kind="java" basedOn="org.eclipse.jface.text.templates.TemplateVariableResolver"/>
               </appInfo>
            </annotation>
         </attribute>
         <attribute name="description" type="string">
            <annotation>
               <documentation>
                  the description of this variable resolver. This property will be set on the resolver once it gets created.
               </documentation>
               <appInfo>
                  <meta.attribute translatable="true"/>
               </appInfo>
            </annotation>
         </attribute>
         <attribute name="name" type="string">
            <annotation>
               <documentation>
                  the display name of this resolver
               </documentation>
               <appInfo>
                  <meta.attribute translatable="true"/>
               </appInfo>
            </annotation>
         </attribute>
         <attribute name="icon" type="string">
            <annotation>
               <documentation>
                  an icon that may be displayed in the user interface
               </documentation>
               <appInfo>
                  <meta.attribute kind="resource"/>
               </appInfo>
            </annotation>
         </attribute>
      </complexType>
   </element>

   <element name="template">
      <annotation>
         <appInfo>
            <meta.element labelAttribute="name" icon="icon"/>
         </appInfo>
         <documentation>
            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 &lt;tt&gt;${variable_type}&lt;/tt&gt; notation.
         </documentation>
      </annotation>
      <complexType>
         <sequence>
            <element ref="pattern"/>
         </sequence>
         <attribute name="id" type="string" use="required">
            <annotation>
               <documentation>
                  unambiguously identifies this template. Use of a qualified name is recommended.
               </documentation>
            </annotation>
         </attribute>
         <attribute name="contextTypeId" type="string" use="required">
            <annotation>
               <documentation>
                  references the context type that this template is contributed to
               </documentation>
               <appInfo>
                  <meta.attribute kind="identifier" basedOn="org.eclipse.ui.editors.templates/contextType/@id"/>
               </appInfo>
            </annotation>
         </attribute>
         <attribute name="name" type="string" use="required">
            <annotation>
               <documentation>
                  the internationalizable name of the template which will show up in the UI, such as in template proposals
               </documentation>
               <appInfo>
                  <meta.attribute translatable="true"/>
               </appInfo>
            </annotation>
         </attribute>
         <attribute name="description" type="string">
            <annotation>
               <documentation>
                  the description of this template
               </documentation>
               <appInfo>
                  <meta.attribute translatable="true"/>
               </appInfo>
            </annotation>
         </attribute>
         <attribute name="icon" type="string">
            <annotation>
               <documentation>
                  an icon that may be displayed in the UI for this template, for example in content assist proposals
               </documentation>
               <appInfo>
                  <meta.attribute kind="resource"/>
               </appInfo>
            </annotation>
         </attribute>
         <attribute name="autoinsert" type="boolean" use="default" value="true">
            <annotation>
               <documentation>
                  &lt;code&gt;true&lt;/code&gt; (default) to make the template automatically insertable, &lt;code&gt;false&lt;/code&gt; to not allow automatic insertion. Since 3.1.
               </documentation>
            </annotation>
         </attribute>
      </complexType>
   </element>

   <element name="pattern" type="string">
      <annotation>
         <documentation>
            The template pattern.
         </documentation>
      </annotation>
   </element>

   <element name="include">
      <annotation>
         <documentation>
            A collection of templates encoded as XML can be included as a whole via this element.
         </documentation>
      </annotation>
      <complexType>
         <attribute name="file" type="string" use="required">
            <annotation>
               <documentation>
                  the XML file to import templates from. It defines at least one &amp;lt;template&amp;gt; element inside &amp;lt;templates&amp;gt;...&amp;lt;/templates&amp;gt;, with the following attributes:
&lt;ul&gt;
	&lt;li&gt;id - the uniqe id&lt;/li&gt;
	&lt;li&gt;name - the name&lt;/li&gt;
	&lt;li&gt;context - the context id&lt;/li&gt;
	&lt;li&gt;description - the description (optional, default: &quot;&quot;)&lt;/li&gt;
	&lt;li&gt;autoinsert (optional, default: true)&lt;/li&gt;
	&lt;li&gt;enabled (optional, default: true)&lt;/li&gt;
&lt;/ul&gt;
See above template element for more details about those attributes.
               </documentation>
               <appInfo>
                  <meta.attribute kind="resource"/>
               </appInfo>
            </annotation>
         </attribute>
         <attribute name="translations" type="string">
            <annotation>
               <documentation>
                  an optional properties file with resources for the templates specified in &lt;tt&gt;file&lt;/tt&gt;.
&lt;br&gt;
&lt;em&gt;Note:&lt;/em&gt; 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 &apos;nl&apos; directory i.e. if a [plugin] defines a template translations file in its plugin.xml like:
&lt;pre&gt;
...
  translations=$nl$/[plugin-relative path to file]
...
&lt;/pre&gt;
then the translations must go into:
&lt;pre&gt;
  [plugins nl fragment]/nl/[locale]/templates/[plugin-relative path to file]
&lt;/pre&gt;
               </documentation>
               <appInfo>
                  <meta.attribute kind="resource"/>
               </appInfo>
            </annotation>
         </attribute>
      </complexType>
   </element>

   <element name="contextTypeRegistry">
      <annotation>
         <documentation>
            Defines a registry for context types. Context types which define a &apos;registryId&apos; are automatically added to the registry which is created by &lt;code&gt;new org.eclipse.ui.editors.text.templates.ContributionContextTypeRegistry(registryId)&lt;/code&gt;. Since 3.5.
         </documentation>
      </annotation>
      <complexType>
         <attribute name="id" type="string">
            <annotation>
               <documentation>
                  the id of this registry
               </documentation>
            </annotation>
         </attribute>
      </complexType>
   </element>

   <annotation>
      <appInfo>
         <meta.section type="since"/>
      </appInfo>
      <documentation>
         3.0
      </documentation>
   </annotation>

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

   <annotation>
      <appInfo>
         <meta.section type="apiInfo"/>
      </appInfo>
      <documentation>
         See the &lt;code&gt;org.eclipse.jface.text.templates&lt;/code&gt; package in the &lt;tt&gt;org.eclipse.text&lt;/tt&gt; plug-in for the relevant API.
      </documentation>
   </annotation>

   <annotation>
      <appInfo>
         <meta.section type="implementation"/>
      </appInfo>
      <documentation>
         See the &lt;code&gt;org.eclipse.jface.text.templates&lt;/code&gt; package in the &lt;tt&gt;org.eclipse.text&lt;/tt&gt; plug-in for the relevant classes.
      </documentation>
   </annotation>

   <annotation>
      <appInfo>
         <meta.section type="copyright"/>
      </appInfo>
      <documentation>
         Copyright (c) 2001, 2010 IBM Corporation and others.&lt;br&gt;

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 &lt;a href=&quot;https://www.eclipse.org/legal/epl-2.0&quot;&gt;https://www.eclipse.org/legal/epl-v20.html&lt;/a&gt;/

SPDX-License-Identifier: EPL-2.0
      </documentation>
   </annotation>

</schema>

Back to the top