Skip to main content
aboutsummaryrefslogtreecommitdiffstats
blob: 54ba81578bc80f05b11bc86336c8aed5be533e5d (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
<?xml version='1.0' encoding='UTF-8'?>
<!-- Schema file written by PDE -->
<schema targetNamespace="org.eclipse.papyrus.infra.ui" xmlns="http://www.w3.org/2001/XMLSchema">
<annotation>
      <appInfo>
         <meta.schema plugin="org.eclipse.papyrus.infra.ui" id="papyrusDiagram" name="Papyrus Diagram Editor"/>
      </appInfo>
      <documentation>
         &lt;p&gt;
The &lt;code&gt;org.eclipse.papyrus.infra.ui.papyrusDiagram&lt;/code&gt; extension point is used to register a new diagram editor within Papyrus. Once diagram editor is registered it can be used in the Papyrus multi-page diagram editor. The editor can have its own icon, label, a button for the creation action in the toolbar, and the possibility to be created using new Papyrus Model wizard.
&lt;/p&gt;

&lt;p&gt;Papyrus uses the term &quot;&lt;b&gt;Diagram Category&lt;/b&gt;&quot; to categorize domain models and the term &quot;&lt;b&gt;Diagram Kind&lt;/b&gt;&quot; to specialize a diagram editor for a domain model. Each Diagram Kind belongs to exactly one Diagram Category, Diagram Category can contains many Diagram Kinds. Papyrus supports &lt;b&gt;UML&lt;/b&gt;, &lt;b&gt;Profile&lt;/b&gt; and &lt;b&gt;SysML&lt;/b&gt; diagram categories. 
&lt;/p&gt;

&lt;p&gt;Besides, for a given diagram category the user can specify template models - a predefined model whose content is copied into a newly created diagram. Templates can be registered using &lt;code&gt;org.eclipse.papyrus.wizards.templates&lt;/code&gt; extension point. Diagram kinds and available templates are filtered in the wizard in accordance with the chosen category. For example, if the user choses &lt;i&gt;Profile&lt;/i&gt; category, then only Profile diagram kind are available on DiagramKindPage and only ProfileWithBasicTypes template is displayed in the list of available templates.
&lt;/p&gt;

&lt;p&gt;The user is free to use the already existing diagram categories as well as implement his own. 
&lt;/p&gt;
      </documentation>
   </annotation>

   <element name="extension">
      <annotation>
         <appInfo>
            <meta.element />
         </appInfo>
      </annotation>
      <complexType>
         <sequence>
            <element ref="editorDiagram" minOccurs="0" maxOccurs="unbounded"/>
            <element ref="creationCommand" minOccurs="0" maxOccurs="unbounded"/>
            <element ref="actionBarContributor" minOccurs="0" maxOccurs="unbounded"/>
         </sequence>
         <attribute name="point" type="string" use="required">
            <annotation>
               <documentation>
                  
               </documentation>
            </annotation>
         </attribute>
         <attribute name="id" type="string">
            <annotation>
               <documentation>
                  
               </documentation>
            </annotation>
         </attribute>
         <attribute name="name" type="string">
            <annotation>
               <documentation>
                  
               </documentation>
               <appInfo>
                  <meta.attribute translatable="true"/>
               </appInfo>
            </annotation>
         </attribute>
      </complexType>
   </element>

   <element name="editorDiagram">
      <annotation>
         <documentation>
            A diagram editor that can be used in the Papyrus multi-page diagram editor.
         </documentation>
      </annotation>
      <complexType>
         <attribute name="factoryClass" type="string" use="required">
            <annotation>
               <documentation>
                  a name of the fully qualified class that implements &lt;samp&gt; org.eclipse.papyrus.infra.ui.extension.diagrameditor.IPluggableEditorFactory&lt;/samp&gt;. It is used to create an instance of the editor.
               </documentation>
               <appInfo>
                  <meta.attribute kind="java" basedOn=":org.eclipse.papyrus.infra.ui.extension.diagrameditor.IPluggableEditorFactory"/>
               </appInfo>
            </annotation>
         </attribute>
         <attribute name="actionBarContributorId" type="string">
            <annotation>
               <documentation>
                  The ID of an ActionBarContributor. If no ID is set, the main ActionBarContributor is used (the one associated to the MultiEditor).
               </documentation>
            </annotation>
         </attribute>
         <attribute name="icon" type="string">
            <annotation>
               <documentation>
                  a relative path of an icon used to visually represent the diagram  in outline tree. The path is relative to the location of the plugin.xml file of the contributing plug-in.
               </documentation>
               <appInfo>
                  <meta.attribute kind="resource"/>
               </appInfo>
            </annotation>
         </attribute>
         <attribute name="order" type="string" use="default" value="0">
            <annotation>
               <documentation>
                  The order of this factory. The order is used when several factories can handle the same element. An order of 0 is a very high priority, whereas an order of 50 is lower. Factories with a higher order (lower priority) can still be used e.g. via the Open with... menu
               </documentation>
            </annotation>
         </attribute>
      </complexType>
   </element>

   <element name="actionBarContributor">
      <annotation>
         <documentation>
            A ActionBarContributor defines the actions for one or more editors or Views.
         </documentation>
      </annotation>
      <complexType>
         <attribute name="id" type="string" use="required">
            <annotation>
               <documentation>
                  a unique identifier used as a reference for this ActionBarContributor. It is used to associate the ActionBarContributor to editors(see &lt;code&gt;actionBarContributorId&lt;/code&gt; attribute of &lt;code&gt;editorDiagram&lt;/code&gt; extension point)
               </documentation>
            </annotation>
         </attribute>
         <attribute name="implementingClass" type="string" use="required">
            <annotation>
               <documentation>
                  a name of the fully qualified class that implements &lt;samp&gt;org.eclipse.ui.IEditorActionBarContributor&lt;/samp&gt;.
               </documentation>
               <appInfo>
                  <meta.attribute kind="java" basedOn="org.eclipse.ui.part.EditorActionBarContributor:"/>
               </appInfo>
            </annotation>
         </attribute>
      </complexType>
   </element>

   <element name="creationCommand">
      <annotation>
         <documentation>
            A &quot;creationCommand&quot; is a command used to create a new diagram.
         </documentation>
      </annotation>
      <complexType>
         <attribute name="id" type="string" use="required">
            <annotation>
               <documentation>
                  a unique identifier used as a reference for this creation command.
               </documentation>
               <appInfo>
                  <meta.attribute kind="identifier" basedOn="org.eclipse.ui.commands/command/@id"/>
               </appInfo>
            </annotation>
         </attribute>
         <attribute name="label" type="string" use="required">
            <annotation>
               <documentation>
                  a translatable name of the creation command. It is displayed in the toolbar as a button text of CreateDiagramAction, this label is also i the New Wizard while selecting the Diagram Kind.
               </documentation>
            </annotation>
         </attribute>
         <attribute name="creationCommandClass" type="string" use="required">
            <annotation>
               <documentation>
                  a name of the fully qualified class that implements &lt;samp&gt;org.eclipse.papyrus.commands.ICreationCommand&lt;/samp&gt;.
               </documentation>
               <appInfo>
                  <meta.attribute kind="java" basedOn=":org.eclipse.papyrus.commands.ICreationCommand"/>
               </appInfo>
            </annotation>
         </attribute>
         <attribute name="icon" type="string">
            <annotation>
               <documentation>
                  a relative path of an icon used to visually represent the command. The path is relative to the location of the plugin.xml file of the contributing plug-in.
               </documentation>
               <appInfo>
                  <meta.attribute kind="resource"/>
               </appInfo>
            </annotation>
         </attribute>
         <attribute name="creationCondition" type="string">
            <annotation>
               <documentation>
                  the action in the diagram creation menu is disabled if this condition is evaluated to false.
               </documentation>
               <appInfo>
                  <meta.attribute kind="java" basedOn=":org.eclipse.papyrus.infra.ui.extension.commands.ICreationCondition"/>
               </appInfo>
            </annotation>
         </attribute>
         <attribute name="language" type="string" use="required">
            <annotation>
               <documentation>
                  the id of a diagramCategory the creation command belongs to.
               </documentation>
               <appInfo>
                  <meta.attribute kind="identifier" basedOn="org.eclipse.papyrus.infra.ui.papyrusDiagram/diagramCategory/@id"/>
               </appInfo>
            </annotation>
         </attribute>
      </complexType>
   </element>

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

   <annotation>
      <appInfo>
         <meta.section type="examples"/>
      </appInfo>
      <documentation>
         &lt;pre&gt;
&lt;extension point=&quot;org.eclipse.papyrus.infra.ui.papyrusDiagram&quot;&gt;
 &lt;diagramCategory
        id=&quot;sysml&quot;
     class=&quot;org.eclipse.papyrus.sysml.diagram.common.commands.CreateSysMLModelCommand&quot;
        label=&quot;SysML&quot;
        description=&quot;SysML diagrams&quot;
        icon=&quot;icons/category_sysml.gif&quot;&gt;
 &lt;/diagramCategory&gt; 

 &lt;editorDiagram
     actionBarContributorId=&quot;org.eclipse.papyrus.uml.diagram.common.part.UMLDiagramActionBarContributor&quot;
        factoryClass=&quot;org.eclipse.papyrus.sysml.diagram.requirement.RequirementDiagramEditorFactory&quot;
        icon=&quot;icons/obj16/Diagram_Requirement.gif&quot;&gt;
 &lt;/editorDiagram&gt;

 &lt;creationCommand
        id=&quot;org.eclipse.papyrus.sysml.diagram.requirement.CreateCommand&quot;
     creationCommandClass=&quot;org.eclipse.papyrus.sysml.diagram.requirement.RequirementDiagramCreateCommand&quot;
        icon=&quot;icons/obj16/Diagram_Requirement.gif&quot;
        label=&quot;SysML Requirement Diagram&quot;
  language=&quot;sysml&quot;&gt;
 &lt;/creationCommand&gt;
&lt;/extension&gt;
&lt;/pre&gt;  
In this example, a specific editor for SysML Requirement diagram is registered. 
Besides, a diagram category for SysML diagrams is defined, it has &lt;code&gt;sysml&lt;/code&gt; id. The category specifies a customized creation command &lt;code&gt;org.eclipse.papyrus.sysml.diagram.common.commands.CreateSysMLModelCommand&lt;/code&gt; which applies a profile to the newly-created model. In this example, the category &lt;code&gt;sysml&lt;/code&gt; containes only one diagram kind - Requirement diagram created with &lt;code&gt;org.eclipse.papyrus.sysml.diagram.requirement.CreateCommand&lt;/code&gt;, but it can be used by other diagrams as well.  
As Requirement diagram belongs to SysML category it will be created with a SysML profile applied to its root.
      </documentation>
   </annotation>

   <annotation>
      <appInfo>
         <meta.section type="apiInfo"/>
      </appInfo>
      <documentation>
         &lt;p&gt;The value of the &lt;code&gt;class&lt;/code&gt; attribute of &lt;code&gt;diagramCategory&lt;/code&gt; must represent a class that implements the &lt;code&gt;org.eclipse.papyrus.infra.architecture.commands.IModelCreationCommand&lt;/code&gt; interface. There are a few default implementations of &lt;code&gt;IModelCreationCommand&lt;/code&gt; that may be useful to users of this extension point: 
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;org.eclipse.papyrus.commands.ModelCreationCommandBase&lt;/code&gt; - an abstract implementation of a basic &lt;code&gt;IModelCreationCommand&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;org.eclipse.papyrus.uml.diagram.common.commands.CreateUMLModelCommand&lt;/code&gt;&lt;/li&gt; - implementation of IModelCreationCommand that creates a UML model.
&lt;li&gt;&lt;code&gt;org.eclipse.papyrus.uml.diagram.profile.CreateProfileModelCommand&lt;/code&gt; - a subclass of CreateUMLModelCommand which creates Profile as a root element&lt;/li&gt;
&lt;li&gt;&lt;code&gt;org.eclipse.papyrus.sysml.diagram.common.commands.CreateSysMLModelCommand&lt;/code&gt; - a subclass of CreateUMLModelCommand which applies SysML profile to the root element&lt;/li&gt;
&lt;/ul&gt;
&lt;/p&gt;

&lt;p&gt;The value of the &lt;code&gt;creationCommandClass&lt;/code&gt; attribute of &lt;code&gt;creationCommand&lt;/code&gt;
 must represent a class that implements the &lt;code&gt;org.eclipse.papyrus.commands.ICreationCommand&lt;/code&gt; interface.
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;org.eclipse.papyrus.infra.gmfdiag.common.AbstractPapyrusGmfCreateDiagramCommandHandler&lt;/code&gt; - an abstract implementation of a basic &lt;code&gt;ICreationCommand&lt;/code&gt; for GMF diagrams. All CreationCommands for Papyrus diagrams extend this class.&lt;/li&gt;
&lt;/ul&gt;
&lt;/p&gt;
      </documentation>
   </annotation>


   <annotation>
      <appInfo>
         <meta.section type="copyright"/>
      </appInfo>
      <documentation>
         Copyright (c) 2008, 2010 CEA List.&lt;br&gt;
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 &lt;a 
href=&quot;http://www.eclipse.org/legal/epl-v10.html&quot;&gt;http://www.eclipse.org/legal/epl-v10.html&lt;/a&gt;
      </documentation>
   </annotation>

</schema>

Back to the top