Skip to main content
aboutsummaryrefslogtreecommitdiffstats
blob: 68ed57db77086f5fab29bd50fc7b8a3589a0152a (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
<!doctype html public "-//w3c//dtd html 4.0 transitional//en">
<html>
<head>
   <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
   <meta name="GENERATOR" content="Mozilla/4.76 [en] (Windows NT 5.0; U) [Netscape]">
   <title>Desktop - Template Editor Example</title>
</head>
<body>

<h2>
<b>Example - Template Editor</b></h2>

<h3>
Introduction</h3>
The Template Editor example demonstrates how to add template support to an editor. The example is 
based on the PDE example editor project that can be created using the new project wizard. The editor 
is a simple XML editor; it is only for demonstration purposes.
<h3>
<b>Features demonstrated in the template editor</b></h3>

<ul>
<li>
creating a template context for an editor</li>

<li>
setting up a content assist processor that will propose template completions</li>

<li>
contributing a context type and variable resolvers to an editor via plugin.xml</li>

<li>
contributing templates to a context type via plugin.xml</li>

<li>
adding a preference page for handling templates, both contributed and user-added</li>

</ul>

<h3>
Features not demonstrated</h3>

<ul>
<li>
template formatting</li>
</ul>

<h3>
Code organization of the template editor example</h3>
The example code is organized in three packages:
<ul>
<li>
<tt>org.eclipse.ui.examples.templateeditor.editors</tt> contains all the editor specific
classes. See <code>XMLConfiguration</code> to see how the <code>TemplateCompletionProcessor</code>
is added in the <code>getContentAssistant</code> method.</li>

<li>
<tt>org.eclipse.ui.examples.templateeditor.preferences</tt> contains the contributed template
preference page.</li>

<li>
<tt>org.eclipse.ui.examples.templateeditor.template</tt> contains the example context type, the
completion processor and the variable resolver that is contributed via plugin.xml.</li>
</ul>

<br>&nbsp;
<p><a href="hglegal2003.htm"><img src="ngibmcpy2003.gif" alt="Copyright IBM Corporation and others 2000, 2003" border="0" width="324" height="14"></a>
</p>
</body>
</html>

Back to the top