blob: 8ec1338d3a35f50456fc43c9cf769a423f6c6b3a [file] [log] [blame]
mwenzb5dc2f92010-06-16 13:24:52 +00001<html>
jpasch1c6a0872011-04-28 15:06:32 +00002
mwenzb5dc2f92010-06-16 13:24:52 +00003<head>
jpasch1c6a0872011-04-28 15:06:32 +00004<meta http-equiv=Content-Type content="text/html; charset=us-ascii">
5<meta name=Generator content="Microsoft Word 12 (filtered)">
mwenzb5dc2f92010-06-16 13:24:52 +00006<title>Diagram</title>
jpasch1c6a0872011-04-28 15:06:32 +00007<link rel=Stylesheet type="text/css" media=all href="../book.css">
8<style>
mwenzb5dc2f92010-06-16 13:24:52 +00009<!--
10 /* Font Definitions */
11 @font-face
jpasch1c6a0872011-04-28 15:06:32 +000012 {font-family:"Cambria Math";
13 panose-1:2 4 5 3 5 4 6 3 2 4;}
mwenzb5dc2f92010-06-16 13:24:52 +000014@font-face
jpasch1c6a0872011-04-28 15:06:32 +000015 {font-family:Cambria;
16 panose-1:2 4 5 3 5 4 6 3 2 4;}
mwenzb5dc2f92010-06-16 13:24:52 +000017@font-face
jpasch1c6a0872011-04-28 15:06:32 +000018 {font-family:Tahoma;
19 panose-1:2 11 6 4 3 5 4 4 2 4;}
mwenzb5dc2f92010-06-16 13:24:52 +000020@font-face
jpasch1c6a0872011-04-28 15:06:32 +000021 {font-family:Consolas;
22 panose-1:2 11 6 9 2 2 4 3 2 4;}
mwenzb5dc2f92010-06-16 13:24:52 +000023 /* Style Definitions */
24 p.MsoNormal, li.MsoNormal, div.MsoNormal
jpasch1c6a0872011-04-28 15:06:32 +000025 {margin:0cm;
26 margin-bottom:.0001pt;
27 font-size:12.0pt;
28 font-family:"Times New Roman","serif";}
mwenzb5dc2f92010-06-16 13:24:52 +000029h1
jpasch1c6a0872011-04-28 15:06:32 +000030 {mso-style-link:"\00DCberschrift 1 Zchn";
31 margin-top:12.0pt;
32 margin-right:0cm;
33 margin-bottom:3.0pt;
34 margin-left:0cm;
35 page-break-after:avoid;
36 font-size:16.0pt;
37 font-family:"Times New Roman","serif";
38 font-weight:bold;}
mwenzb5dc2f92010-06-16 13:24:52 +000039h2
jpasch1c6a0872011-04-28 15:06:32 +000040 {mso-style-link:"\00DCberschrift 2 Zchn";
41 margin-top:12.0pt;
42 margin-right:0cm;
43 margin-bottom:3.0pt;
44 margin-left:0cm;
45 page-break-after:avoid;
46 font-size:14.0pt;
47 font-family:"Times New Roman","serif";
48 font-weight:bold;
49 font-style:italic;}
mwenzb5dc2f92010-06-16 13:24:52 +000050h3
jpasch1c6a0872011-04-28 15:06:32 +000051 {mso-style-link:"\00DCberschrift 3 Zchn";
52 margin-top:12.0pt;
53 margin-right:0cm;
54 margin-bottom:3.0pt;
55 margin-left:0cm;
56 page-break-after:avoid;
57 font-size:13.0pt;
58 font-family:"Times New Roman","serif";
59 font-weight:bold;}
mwenzb5dc2f92010-06-16 13:24:52 +000060h4
jpasch1c6a0872011-04-28 15:06:32 +000061 {mso-style-link:"\00DCberschrift 4 Zchn";
62 margin-top:11.25pt;
63 margin-right:0cm;
64 margin-bottom:1.7pt;
65 margin-left:0cm;
66 font-size:12.0pt;
67 font-family:"Times New Roman","serif";
68 font-weight:bold;
69 font-style:italic;}
mwenzb5dc2f92010-06-16 13:24:52 +000070h5
jpasch1c6a0872011-04-28 15:06:32 +000071 {mso-style-link:"\00DCberschrift 5 Zchn";
72 margin-right:0cm;
73 margin-left:0cm;
74 font-size:10.0pt;
75 font-family:"Times New Roman","serif";
76 font-weight:bold;}
mwenzb5dc2f92010-06-16 13:24:52 +000077h6
jpasch1c6a0872011-04-28 15:06:32 +000078 {mso-style-link:"\00DCberschrift 6 Zchn";
79 margin-right:0cm;
80 margin-left:0cm;
81 font-size:7.5pt;
82 font-family:"Times New Roman","serif";
83 font-weight:bold;}
mwenzb5dc2f92010-06-16 13:24:52 +000084p.MsoCommentText, li.MsoCommentText, div.MsoCommentText
jpasch1c6a0872011-04-28 15:06:32 +000085 {mso-style-link:"Kommentartext Zchn";
86 margin-top:6.0pt;
87 margin-right:0cm;
88 margin-bottom:0cm;
89 margin-left:0cm;
90 margin-bottom:.0001pt;
91 text-align:justify;
92 font-size:10.0pt;
93 font-family:"Times New Roman","serif";}
mwenzb5dc2f92010-06-16 13:24:52 +000094a:link, span.MsoHyperlink
jpasch1c6a0872011-04-28 15:06:32 +000095 {color:blue;
96 text-decoration:underline;}
mwenzb5dc2f92010-06-16 13:24:52 +000097a:visited, span.MsoHyperlinkFollowed
jpasch1c6a0872011-04-28 15:06:32 +000098 {color:purple;
99 text-decoration:underline;}
100p.MsoDocumentMap, li.MsoDocumentMap, div.MsoDocumentMap
101 {mso-style-link:"Dokumentstruktur Zchn";
102 margin:0cm;
103 margin-bottom:.0001pt;
104 font-size:8.0pt;
105 font-family:"Tahoma","sans-serif";}
mwenzb5dc2f92010-06-16 13:24:52 +0000106p
jpasch1c6a0872011-04-28 15:06:32 +0000107 {margin-top:5.65pt;
108 margin-right:0cm;
109 margin-bottom:5.65pt;
110 margin-left:0cm;
111 font-size:12.0pt;
112 font-family:"Times New Roman","serif";}
mwenzb5dc2f92010-06-16 13:24:52 +0000113pre
jpasch1c6a0872011-04-28 15:06:32 +0000114 {mso-style-link:"HTML Vorformatiert Zchn";
115 margin-top:0cm;
116 margin-right:0cm;
117 margin-bottom:0cm;
118 margin-left:3.4pt;
119 margin-bottom:.0001pt;
120 font-size:11.0pt;
121 font-family:"Courier New";}
mwenzb5dc2f92010-06-16 13:24:52 +0000122p.MsoAcetate, li.MsoAcetate, div.MsoAcetate
jpasch1c6a0872011-04-28 15:06:32 +0000123 {mso-style-link:"Sprechblasentext Zchn";
124 margin:0cm;
125 margin-bottom:.0001pt;
126 font-size:8.0pt;
127 font-family:"Tahoma","sans-serif";}
mwenzb5dc2f92010-06-16 13:24:52 +0000128span.berschrift1Zchn
jpasch1c6a0872011-04-28 15:06:32 +0000129 {mso-style-name:"\00DCberschrift 1 Zchn";
130 mso-style-link:"\00DCberschrift 1";
131 font-family:"Cambria","serif";
132 color:#365F91;
133 font-weight:bold;}
mwenzb5dc2f92010-06-16 13:24:52 +0000134span.berschrift2Zchn
jpasch1c6a0872011-04-28 15:06:32 +0000135 {mso-style-name:"\00DCberschrift 2 Zchn";
136 mso-style-link:"\00DCberschrift 2";
137 font-family:"Cambria","serif";
138 color:#4F81BD;
139 font-weight:bold;}
mwenzb5dc2f92010-06-16 13:24:52 +0000140span.berschrift3Zchn
jpasch1c6a0872011-04-28 15:06:32 +0000141 {mso-style-name:"\00DCberschrift 3 Zchn";
142 mso-style-link:"\00DCberschrift 3";
143 font-family:"Cambria","serif";
144 color:#4F81BD;
145 font-weight:bold;}
mwenzb5dc2f92010-06-16 13:24:52 +0000146span.berschrift4Zchn
jpasch1c6a0872011-04-28 15:06:32 +0000147 {mso-style-name:"\00DCberschrift 4 Zchn";
148 mso-style-link:"\00DCberschrift 4";
149 font-family:"Cambria","serif";
150 color:#4F81BD;
151 font-weight:bold;
152 font-style:italic;}
mwenzb5dc2f92010-06-16 13:24:52 +0000153span.berschrift5Zchn
jpasch1c6a0872011-04-28 15:06:32 +0000154 {mso-style-name:"\00DCberschrift 5 Zchn";
155 mso-style-link:"\00DCberschrift 5";
156 font-family:"Cambria","serif";
157 color:#243F60;}
mwenzb5dc2f92010-06-16 13:24:52 +0000158span.berschrift6Zchn
jpasch1c6a0872011-04-28 15:06:32 +0000159 {mso-style-name:"\00DCberschrift 6 Zchn";
160 mso-style-link:"\00DCberschrift 6";
161 font-family:"Cambria","serif";
162 color:#243F60;
163 font-style:italic;}
mwenzb5dc2f92010-06-16 13:24:52 +0000164span.HTMLVorformatiertZchn
jpasch1c6a0872011-04-28 15:06:32 +0000165 {mso-style-name:"HTML Vorformatiert Zchn";
166 mso-style-link:"HTML Vorformatiert";
167 font-family:Consolas;}
mwenzb5dc2f92010-06-16 13:24:52 +0000168span.KommentartextZchn
jpasch1c6a0872011-04-28 15:06:32 +0000169 {mso-style-name:"Kommentartext Zchn";
170 mso-style-link:Kommentartext;
171 font-family:"Times New Roman","serif";}
mwenzb5dc2f92010-06-16 13:24:52 +0000172span.SprechblasentextZchn
jpasch1c6a0872011-04-28 15:06:32 +0000173 {mso-style-name:"Sprechblasentext Zchn";
174 mso-style-link:Sprechblasentext;
175 font-family:"Tahoma","sans-serif";}
mwenzb5dc2f92010-06-16 13:24:52 +0000176p.code, li.code, div.code
jpasch1c6a0872011-04-28 15:06:32 +0000177 {mso-style-name:code;
178 margin-top:0cm;
179 margin-right:0cm;
180 margin-bottom:0cm;
181 margin-left:15.0pt;
182 margin-bottom:.0001pt;
183 font-size:12.0pt;
184 font-family:"Times New Roman","serif";}
mwenzb5dc2f92010-06-16 13:24:52 +0000185p.note, li.note, div.note
jpasch1c6a0872011-04-28 15:06:32 +0000186 {mso-style-name:note;
187 margin-top:19.5pt;
188 margin-right:0cm;
189 margin-bottom:19.5pt;
190 margin-left:30.0pt;
191 font-size:13.0pt;
192 font-family:"Times New Roman","serif";
193 font-style:italic;}
mwenzb5dc2f92010-06-16 13:24:52 +0000194p.msochpdefault, li.msochpdefault, div.msochpdefault
jpasch1c6a0872011-04-28 15:06:32 +0000195 {mso-style-name:msochpdefault;
196 margin-top:5.65pt;
197 margin-right:0cm;
198 margin-bottom:5.65pt;
199 margin-left:0cm;
200 font-size:10.0pt;
201 font-family:"Times New Roman","serif";}
mwenzb5dc2f92010-06-16 13:24:52 +0000202span.Heading1Char
jpasch1c6a0872011-04-28 15:06:32 +0000203 {mso-style-name:"Heading 1 Char";
204 mso-style-link:"Heading 1";
205 font-family:"Cambria","serif";
206 color:#365F91;
207 font-weight:bold;}
mwenzb5dc2f92010-06-16 13:24:52 +0000208p.Heading1, li.Heading1, div.Heading1
jpasch1c6a0872011-04-28 15:06:32 +0000209 {mso-style-name:"Heading 1";
210 mso-style-link:"Heading 1 Char";
211 margin:0cm;
212 margin-bottom:.0001pt;
213 font-size:12.0pt;
214 font-family:"Times New Roman","serif";}
mwenzb5dc2f92010-06-16 13:24:52 +0000215span.Heading2Char
jpasch1c6a0872011-04-28 15:06:32 +0000216 {mso-style-name:"Heading 2 Char";
217 mso-style-link:"Heading 2";
218 font-family:"Cambria","serif";
219 color:#4F81BD;
220 font-weight:bold;}
mwenzb5dc2f92010-06-16 13:24:52 +0000221p.Heading2, li.Heading2, div.Heading2
jpasch1c6a0872011-04-28 15:06:32 +0000222 {mso-style-name:"Heading 2";
223 mso-style-link:"Heading 2 Char";
224 margin:0cm;
225 margin-bottom:.0001pt;
226 font-size:12.0pt;
227 font-family:"Times New Roman","serif";}
mwenzb5dc2f92010-06-16 13:24:52 +0000228span.Heading3Char
jpasch1c6a0872011-04-28 15:06:32 +0000229 {mso-style-name:"Heading 3 Char";
230 mso-style-link:"Heading 3";
231 font-family:"Cambria","serif";
232 color:#4F81BD;
233 font-weight:bold;}
mwenzb5dc2f92010-06-16 13:24:52 +0000234p.Heading3, li.Heading3, div.Heading3
jpasch1c6a0872011-04-28 15:06:32 +0000235 {mso-style-name:"Heading 3";
236 mso-style-link:"Heading 3 Char";
237 margin:0cm;
238 margin-bottom:.0001pt;
239 font-size:12.0pt;
240 font-family:"Times New Roman","serif";}
mwenzb5dc2f92010-06-16 13:24:52 +0000241span.Heading4Char
jpasch1c6a0872011-04-28 15:06:32 +0000242 {mso-style-name:"Heading 4 Char";
243 mso-style-link:"Heading 4";
244 font-family:"Cambria","serif";
245 color:#4F81BD;
246 font-weight:bold;
247 font-style:italic;}
mwenzb5dc2f92010-06-16 13:24:52 +0000248p.Heading4, li.Heading4, div.Heading4
jpasch1c6a0872011-04-28 15:06:32 +0000249 {mso-style-name:"Heading 4";
250 mso-style-link:"Heading 4 Char";
251 margin:0cm;
252 margin-bottom:.0001pt;
253 font-size:12.0pt;
254 font-family:"Times New Roman","serif";}
mwenzb5dc2f92010-06-16 13:24:52 +0000255span.Heading5Char
jpasch1c6a0872011-04-28 15:06:32 +0000256 {mso-style-name:"Heading 5 Char";
257 mso-style-link:"Heading 5";
258 font-family:"Cambria","serif";
259 color:#243F60;}
mwenzb5dc2f92010-06-16 13:24:52 +0000260p.Heading5, li.Heading5, div.Heading5
jpasch1c6a0872011-04-28 15:06:32 +0000261 {mso-style-name:"Heading 5";
262 mso-style-link:"Heading 5 Char";
263 margin:0cm;
264 margin-bottom:.0001pt;
265 font-size:12.0pt;
266 font-family:"Times New Roman","serif";}
mwenzb5dc2f92010-06-16 13:24:52 +0000267span.Heading6Char
jpasch1c6a0872011-04-28 15:06:32 +0000268 {mso-style-name:"Heading 6 Char";
269 mso-style-link:"Heading 6";
270 font-family:"Cambria","serif";
271 color:#243F60;
272 font-style:italic;}
mwenzb5dc2f92010-06-16 13:24:52 +0000273p.Heading6, li.Heading6, div.Heading6
jpasch1c6a0872011-04-28 15:06:32 +0000274 {mso-style-name:"Heading 6";
275 mso-style-link:"Heading 6 Char";
276 margin:0cm;
277 margin-bottom:.0001pt;
278 font-size:12.0pt;
279 font-family:"Times New Roman","serif";}
mwenzb5dc2f92010-06-16 13:24:52 +0000280span.HTMLPreformattedChar
jpasch1c6a0872011-04-28 15:06:32 +0000281 {mso-style-name:"HTML Preformatted Char";
282 mso-style-link:"HTML Preformatted";
283 font-family:Consolas;}
mwenzb5dc2f92010-06-16 13:24:52 +0000284p.HTMLPreformatted, li.HTMLPreformatted, div.HTMLPreformatted
jpasch1c6a0872011-04-28 15:06:32 +0000285 {mso-style-name:"HTML Preformatted";
286 mso-style-link:"HTML Preformatted Char";
287 margin:0cm;
288 margin-bottom:.0001pt;
289 font-size:12.0pt;
290 font-family:"Times New Roman","serif";}
mwenzb5dc2f92010-06-16 13:24:52 +0000291span.CommentTextChar
jpasch1c6a0872011-04-28 15:06:32 +0000292 {mso-style-name:"Comment Text Char";
293 mso-style-link:"Comment Text";
294 font-family:"Times New Roman","serif";}
mwenzb5dc2f92010-06-16 13:24:52 +0000295p.CommentText, li.CommentText, div.CommentText
jpasch1c6a0872011-04-28 15:06:32 +0000296 {mso-style-name:"Comment Text";
297 mso-style-link:"Comment Text Char";
298 margin:0cm;
299 margin-bottom:.0001pt;
300 font-size:12.0pt;
301 font-family:"Times New Roman","serif";}
mwenzb5dc2f92010-06-16 13:24:52 +0000302span.BalloonTextChar
jpasch1c6a0872011-04-28 15:06:32 +0000303 {mso-style-name:"Balloon Text Char";
304 mso-style-link:"Balloon Text";
305 font-family:"Tahoma","sans-serif";}
mwenzb5dc2f92010-06-16 13:24:52 +0000306p.BalloonText, li.BalloonText, div.BalloonText
jpasch1c6a0872011-04-28 15:06:32 +0000307 {mso-style-name:"Balloon Text";
308 mso-style-link:"Balloon Text Char";
309 margin:0cm;
310 margin-bottom:.0001pt;
311 font-size:12.0pt;
312 font-family:"Times New Roman","serif";}
313p.comment, li.comment, div.comment
314 {mso-style-name:comment;
315 margin-top:5.65pt;
316 margin-right:0cm;
317 margin-bottom:5.65pt;
318 margin-left:0cm;
319 font-size:12.0pt;
320 font-family:"Times New Roman","serif";
321 font-weight:bold;}
322span.DokumentstrukturZchn
323 {mso-style-name:"Dokumentstruktur Zchn";
324 mso-style-link:Dokumentstruktur;
325 font-family:"Tahoma","sans-serif";}
mwenzb5dc2f92010-06-16 13:24:52 +0000326.MsoChpDefault
jpasch1c6a0872011-04-28 15:06:32 +0000327 {font-size:10.0pt;}
328@page WordSection1
329 {size:595.3pt 841.9pt;
330 margin:70.85pt 70.85pt 2.0cm 70.85pt;}
331div.WordSection1
332 {page:WordSection1;}
mwenzb5dc2f92010-06-16 13:24:52 +0000333 /* List Definitions */
334 ol
jpasch1c6a0872011-04-28 15:06:32 +0000335 {margin-bottom:0cm;}
mwenzb5dc2f92010-06-16 13:24:52 +0000336ul
jpasch1c6a0872011-04-28 15:06:32 +0000337 {margin-bottom:0cm;}
mwenzb5dc2f92010-06-16 13:24:52 +0000338-->
339</style>
jpasch1c6a0872011-04-28 15:06:32 +0000340
mwenzb5dc2f92010-06-16 13:24:52 +0000341</head>
jpasch1c6a0872011-04-28 15:06:32 +0000342
343<body bgcolor=white lang=DE link=blue vlink=purple style='margin-bottom:12.0pt'>
344
345<div class=WordSection1>
346
mwenzb5dc2f92010-06-16 13:24:52 +0000347<div>
jpasch1c6a0872011-04-28 15:06:32 +0000348
349<h1><span lang=EN-US>Diagram</span></h1>
350
351<p class=MsoNormal><span lang=EN-US style='color:black'>&nbsp;</span></p>
352
353<p class=MsoNormal><span lang=EN-GB style='color:black'>For the creation of an
354editor, it is necessary to implement a <b>diagram type agent</b>. This diagram
355type agent consists of a <b>diagram type provider</b> and a <b>feature provider</b>.
356The minimum implementation of the diagram type provider is described in this
357chapter.</span></p>
358
359<p class=MsoNormal><span lang=EN-GB style='color:black'>&nbsp;</span></p>
360
361<h2><a name="_Toc176747724"><span lang=EN-GB>Create a Plug-In</span></a></h2>
362
363<p class=MsoNormal><span lang=EN-US>&nbsp;</span></p>
364
365<p class=MsoNormal><span lang=EN-US>Create a plug-in project for your diagram
366type specific graphical editor. Please keep in mind <b>not to use</b> the ID <i>org.eclipse.graphiti.tutorial</i>,
367which is the ID of our implementation of the tutorial. Additionally use different
368ID's for implementations of our extension points, see below.</span></p>
369
370<p class=MsoNormal>You should have references to following plug-ins: <i>org.eclipse.graphiti</i>,
371<i>org.eclipse.graphiti.ui</i>, <i>org.eclipse.graphiti.examples.common</i>, <i>org.eclipse.core.resources</i>,
372<i>org.eclipse.core.runtime</i>, <i>org.eclipse.ui.views.properties.tabbed</i>.</p>
373
mwenz1ce39692011-05-11 06:50:24 +0000374<p class=MsoNormal>Hint: the final version of this tutorial as it is included in the SDK download of Graphiti
375actually defines more dependencies; these are introduced in later sections of this tutorial. To start
376off with the tutorial only the above mentioned dependencies are required.</p>
377
jpasch1c6a0872011-04-28 15:06:32 +0000378<h2><a name="_Toc176747725"><span lang=EN-GB>Create a Diagram Type Provider</span></a></h2>
379
380<p class=MsoNormal><span lang=EN-GB style='color:black'>&nbsp;</span></p>
381
382<p class=MsoNormal><span lang=EN-GB style='color:black'>A diagram type provider
383has to implement the interface</span><span lang=EN-GB> </span><span
384class=code1><span lang=EN-US style='color:black'><a
385href="../../../javadoc/org/eclipse/graphiti/dt/IDiagramTypeProvider.html">IDiagramTypeProvider</a></span></span><span
386lang=EN-GB style='color:black'>. Instead of implementing it directly it should
387extend one of the available base classes. In this example we extend the base
388class</span><span lang=EN-GB> </span><span class=code1><span lang=EN-US
389style='color:black'><a
390href="../../../javadoc/org/eclipse/graphiti/dt/AbstractDiagramTypeProvider.html">AbstractDiagramTypeProvider</a>.</span></span></p>
391
392<p class=MsoNormal><span class=code1><span lang=EN-US style='color:black'>&nbsp;</span></span></p>
393
394<p class=MsoNormal><span lang=EN-GB style='color:black'>You can see the
395complete implementation of the diagram type provider here:</span></p>
396
397<p class=MsoNormal><span lang=EN-GB style='color:black'>&nbsp;</span></p>
398
399<table class=MsoNormalTable border=0 cellspacing=0 cellpadding=0 width=680
400 style='width:18.0cm;border-collapse:collapse'>
401 <tr>
402 <td width=680 valign=top style='width:18.0cm;border:solid windowtext 1.0pt;
403 padding:0cm 5.4pt 0cm 5.4pt'>
404 <p class=MsoNormal style='text-autospace:none'><b><span lang=EN-US
405 style='font-size:10.0pt;font-family:"Courier New";color:#7F0055'>&nbsp;</span></b></p>
406 <p class=MsoNormal><b><span lang=EN-US style='font-size:10.0pt;font-family:
407 "Courier New";color:#7F0055'>package</span></b><span lang=EN-US> </span><span
408 lang=EN-US style='font-size:10.0pt;font-family:"Courier New"'>org.eclipse.graphiti.examples.tutorial.diagram;</span></p>
409 <p class=MsoNormal><span lang=EN-US style='font-size:10.0pt;font-family:"Courier New"'>&nbsp;</span></p>
410 <p class=MsoNormal><b><span lang=EN-US style='font-size:10.0pt;font-family:
411 "Courier New";color:#7F0055'>public</span></b><span lang=EN-US> </span><b><span
412 lang=EN-US style='font-size:10.0pt;font-family:"Courier New";color:#7F0055'>class</span></b><span
413 lang=EN-US> </span><span lang=EN-US style='font-size:10.0pt;font-family:"Courier New"'>MyTutorialDiagramTypeProvider
414 <b><span style='color:#7F0055'>extends</span></b> AbstractDiagramTypeProvider
415 {</span></p>
416 <p class=MsoNormal><span lang=EN-US style='font-size:10.0pt;font-family:"Courier New"'>&nbsp;</span></p>
417 <p class=MsoNormal><b><span lang=EN-US style='font-size:10.0pt;font-family:
418 "Courier New";color:#7F0055'>&nbsp; &nbsp;</span></b><b><span
419 style='font-size:10.0pt;font-family:"Courier New";color:#7F0055'>public</span></b>
420 <span style='font-size:10.0pt;font-family:"Courier New"'>MyTutorialDiagramTypeProvider()
421 {</span></p>
422 <p class=MsoNormal><b><span style='font-size:10.0pt;font-family:"Courier New";
423 color:#7F0055'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;super</span></b><span
424 style='font-size:10.0pt;font-family:"Courier New"'>();<br>
425 &nbsp;&nbsp; }</span></p>
426 <p class=MsoNormal><span style='font-size:10.0pt;font-family:"Courier New"'>}</span></p>
427 <p class=MsoNormal>&nbsp;</p>
428 </td>
429 </tr>
mwenzb5dc2f92010-06-16 13:24:52 +0000430</table>
jpasch1c6a0872011-04-28 15:06:32 +0000431
432<p class=MsoNormal><span lang=EN-GB style='color:black'>&nbsp;</span></p>
433
434<p class=MsoNormal><span lang=EN-GB style='color:black'>&nbsp;</span></p>
435
436<h2><a name="_Toc176747726"><span lang=EN-GB>Create a Diagram Type</span></a></h2>
437
438<p class=MsoNormal>&nbsp;</p>
439
440<p class=MsoNormal><span lang=EN-GB style='color:black'>If you create a diagram
441type provider for a diagram type which does not exist in the repository, it is
442necessary to provide also information about this new diagram type.</span><span
443lang=EN-GB> </span><span lang=EN-US style='color:black'>The diagram type</span><span
444lang=EN-US> advertises that the containing diagram type provider understands
445the given diagram type and is suitable for editing and viewing diagrams of that
446type.</span></p>
447
448<p class=MsoNormal><span lang=EN-GB style='color:black'>The information about a
449diagram type must be declared in the plugin.xml.</span></p>
450
451<p class=MsoNormal><span lang=EN-GB style='color:black'>&nbsp;</span></p>
452
453<p class=MsoNormal><span lang=EN-GB style='color:black'>&nbsp;</span></p>
454
455<h2><a name="_Toc176747727"><span lang=EN-GB>Register the Diagram Type Provider
456and Diagram Type</span></a></h2>
457
458<p class=MsoNormal><span lang=EN-GB style='color:black'>&nbsp;</span></p>
459
460<p class=MsoNormal><span lang=EN-GB>The newly created diagram type provider and
461diagram type are registered through the extension points:</span></p>
462
463<ul style='margin-top:0cm' type=disc>
464 <li class=MsoNormal style='margin-top:6.0pt;text-align:justify'><span
465 class=code0><span lang=EN-US><a
466 href="../extension-points/diagramTypes.html">diagramTypes</a></span></span></li>
467 <li class=MsoNormal style='margin-top:6.0pt;text-align:justify'><span
468 class=code0><span lang=EN-US><a
469 href="../extension-points/diagramTypeProviders.html">diagramTypeProviders</a></span></span></li>
mwenzb5dc2f92010-06-16 13:24:52 +0000470</ul>
mwenzb5dc2f92010-06-16 13:24:52 +0000471
jpasch1c6a0872011-04-28 15:06:32 +0000472<p class=MsoNormal><span lang=EN-GB>&nbsp;<span style='color:black'>&nbsp;</span></span></p>
mwenzb5dc2f92010-06-16 13:24:52 +0000473
jpasch1c6a0872011-04-28 15:06:32 +0000474<p class=MsoNormal><span lang=EN-GB style='color:black'>The corresponding <i>plugin.xml</i>
475looks similar to this:</span></p>
476
477<p class=MsoNormal><span lang=EN-GB style='color:black'>&nbsp;</span></p>
478
479<table class=MsoNormalTable border=0 cellspacing=0 cellpadding=0 width=680
480 style='width:18.0cm;margin-left:1.9pt;border-collapse:collapse'>
481 <tr>
482 <td width=680 valign=top style='width:18.0cm;border:solid windowtext 1.0pt;
483 padding:0cm 5.4pt 0cm 5.4pt'>
484 <p class=MsoNormal style='text-autospace:none'><span lang=EN-GB
485 style='font-size:10.0pt;font-family:"Courier New";color:gray'>&nbsp;</span></p>
486 <p class=MsoNormal style='text-autospace:none'><span lang=EN-US
487 style='font-size:10.0pt;font-family:"Courier New";color:gray'>&lt;?xml
488 version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt;</span></p>
489 <p class=MsoNormal style='text-autospace:none'><span lang=EN-US
490 style='font-size:10.0pt;font-family:"Courier New";color:gray'>&lt;?eclipse
491 version=&quot;3.0&quot;?&gt;</span></p>
492 <p class=MsoNormal style='text-autospace:none'><span lang=EN-US
493 style='font-size:10.0pt;font-family:"Courier New";color:navy'>&lt;plugin&gt;</span></p>
494 <p class=MsoNormal style='text-autospace:none'><span lang=EN-US
495 style='font-size:10.0pt;font-family:"Courier New";color:black'>&nbsp;&nbsp;</span><span
496 lang=EN-US style='font-size:10.0pt;font-family:"Courier New";color:navy'>&lt;extension</span></p>
497 <p class=MsoNormal><span lang=EN-US style='font-size:10.0pt;font-family:"Courier New";
498 color:navy'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; point=</span><span lang=EN-US
499 style='font-size:10.0pt;font-family:"Courier New";color:green'>&quot;org.eclipse.graphiti.ui.diagramTypes&quot;</span><span
500 lang=EN-US style='font-size:10.0pt;font-family:"Courier New";color:navy'>&gt;</span></p>
501 <p class=MsoNormal><span lang=EN-US style='font-size:10.0pt;font-family:"Courier New";
502 color:navy'>&nbsp;&nbsp;&nbsp; &lt;diagramType</span></p>
503 <p class=MsoNormal><span lang=EN-US style='font-size:10.0pt;font-family:"Courier New";
504 color:navy'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; description=</span><span
505 lang=EN-US style='font-size:10.0pt;font-family:"Courier New";color:green'>&quot;This
506 is the diagram type for my Graphiti tutorial&quot;</span></p>
507 <p class=MsoNormal><span lang=EN-US style='font-size:10.0pt;font-family:"Courier New";
508 color:navy'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; id=</span><span lang=EN-US
509 style='font-size:10.0pt;font-family:"Courier New";color:green'>&quot;org.eclipse.graphiti.examples.tutorial.diagram.MyTutorialDiagramType&quot;</span></p>
510 <p class=MsoNormal><span lang=EN-US style='font-size:10.0pt;font-family:"Courier New";
511 color:navy'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; name=</span><span lang=EN-US
512 style='font-size:10.0pt;font-family:"Courier New";color:green'>&quot;My
513 Graphiti Tutorial Diagram Type&quot;</span></p>
514 <p class=MsoNormal><span lang=EN-US style='font-size:10.0pt;font-family:"Courier New";
515 color:navy'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; type=</span><span lang=EN-US
516 style='font-size:10.0pt;font-family:"Courier New";color:green'>&quot;mytutorial&quot;</span><span
517 lang=EN-US style='font-size:10.0pt;font-family:"Courier New";color:navy'>&gt;</span></p>
518 <p class=MsoNormal><span lang=EN-US style='font-size:10.0pt;font-family:"Courier New";
519 color:navy'>&nbsp;&nbsp;&nbsp; &lt;/diagramType&gt;</span></p>
520 <p class=MsoNormal><span lang=EN-US style='font-size:10.0pt;font-family:"Courier New";
521 color:navy'>&nbsp; &lt;/extension&gt;</span></p>
522 <p class=MsoNormal><span lang=EN-US style='font-size:10.0pt;font-family:"Courier New"'>&nbsp;</span></p>
523 <p class=MsoNormal><span lang=EN-US style='font-size:10.0pt;font-family:"Courier New";
524 color:navy'>&nbsp; &lt;extension</span></p>
525 <p class=MsoNormal><span lang=EN-US style='font-size:10.0pt;font-family:"Courier New";
526 color:navy'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; point=</span><span lang=EN-US
527 style='font-size:10.0pt;font-family:"Courier New";color:green'>&quot;org.eclipse.graphiti.ui.diagramTypeProviders&quot;</span><span
528 lang=EN-US style='font-size:10.0pt;font-family:"Courier New";color:navy'>&gt;</span></p>
529 <p class=MsoNormal><span lang=EN-US style='font-size:10.0pt;font-family:"Courier New";
530 color:navy'>&nbsp;&nbsp;&nbsp; &lt;diagramTypeProvider</span></p>
531 <p class=MsoNormal><span lang=EN-US style='font-size:10.0pt;font-family:"Courier New";
532 color:navy'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; class=</span><span lang=EN-US
533 style='font-size:10.0pt;font-family:"Courier New";color:green'>&quot;org.eclipse.graphiti.examples.tutorial.diagram.<br>
534 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
535 MyTutorialDiagramTypeProvider&quot;</span></p>
536 <p class=MsoNormal><span lang=EN-US style='font-size:10.0pt;font-family:"Courier New";
537 color:navy'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; description=</span><span
538 lang=EN-US style='font-size:10.0pt;font-family:"Courier New";color:green'>&quot;This
539 is my editor for the Graphiti tutorial&quot;</span></p>
540 <p class=MsoNormal><span lang=EN-US style='font-size:10.0pt;font-family:"Courier New";
541 color:navy'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; id=</span><span lang=EN-US
542 style='font-size:10.0pt;font-family:"Courier New";color:green'>&quot;org.eclipse.graphiti.examples.tutorial.diagram.<br>
543 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
544 MyTutorialDiagramTypeProvider&quot;</span></p>
545 <p class=MsoNormal><span lang=EN-US style='font-size:10.0pt;font-family:"Courier New";
546 color:navy'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; name=</span><span lang=EN-US
547 style='font-size:10.0pt;font-family:"Courier New";color:green'>&quot;My
548 tutorial editor&quot;</span><span lang=EN-US style='font-size:10.0pt;
549 font-family:"Courier New";color:navy'>&gt;</span></p>
550 <p class=MsoNormal><span lang=EN-US style='font-size:10.0pt;font-family:"Courier New";
551 color:navy'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;diagramType</span></p>
552 <p class=MsoNormal><span lang=EN-US style='font-size:10.0pt;font-family:"Courier New";
553 color:navy'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; id=</span><span
554 lang=EN-US style='font-size:10.0pt;font-family:"Courier New";color:green'>&quot;org.eclipse.graphiti.examples.tutorial.diagram.MyTutorialDiagramType&quot;</span><span
555 lang=EN-US style='font-size:10.0pt;font-family:"Courier New";color:navy'>&gt;</span></p>
556 <p class=MsoNormal><span lang=EN-US style='font-size:10.0pt;font-family:"Courier New";
557 color:navy'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span lang=EN-US> </span><span
558 style='font-size:10.0pt;font-family:"Courier New";color:navy'>&lt;/diagramType&gt;</span></p>
559 <p class=MsoNormal><span style='font-size:10.0pt;font-family:"Courier New";
560 color:navy'>&nbsp;&nbsp;&nbsp; &lt;/diagramTypeProvider&gt;</span></p>
561 <p class=MsoNormal><span style='font-size:10.0pt;font-family:"Courier New";
562 color:navy'>&nbsp; &lt;/extension&gt;</span></p>
563 <p class=MsoNormal style='text-autospace:none'><span style='font-size:10.0pt;
564 font-family:"Courier New";color:navy'>&lt;/plugin&gt;</span></p>
565 <p class=MsoNormal style='text-autospace:none'><span style='font-size:10.0pt;
566 font-family:"Courier New";color:black'>&nbsp;</span><span lang=EN-GB
567 style='color:black'>&nbsp;</span></p>
568 </td>
569 </tr>
mwenzb5dc2f92010-06-16 13:24:52 +0000570</table>
jpasch1c6a0872011-04-28 15:06:32 +0000571
572<p class=MsoNormal><span lang=EN-GB style='color:black'>&nbsp;</span></p>
573
574<p class=MsoNormal><span lang=EN-GB style='color:black'>&nbsp;</span></p>
575
576<p class=MsoNormal><span lang=EN-GB style='color:black'>&nbsp;</span><span
577lang=EN-US>For further information to these extension points, see the extension
578point description in the Eclipse IDE.</span></p>
579
580<p class=MsoNormal><span lang=EN-US style='color:black'>&nbsp;</span></p>
581
mwenzb5dc2f92010-06-16 13:24:52 +0000582</div>
jpasch1c6a0872011-04-28 15:06:32 +0000583
584<div class=MsoNormal align=center style='text-align:center'>
585
586<hr size=3 width="100%" align=center>
587
mwenzb5dc2f92010-06-16 13:24:52 +0000588</div>
jpasch1c6a0872011-04-28 15:06:32 +0000589
590<p class=MsoNormal><a href="http://www.eclipse.org/legal/epl-v10.html"
591shape=rect>Copyright (c) SAP AG 2005, 2010.</a></p>
592
593</div>
594
mwenzb5dc2f92010-06-16 13:24:52 +0000595</body>
jpasch1c6a0872011-04-28 15:06:32 +0000596
mwenzb5dc2f92010-06-16 13:24:52 +0000597</html>