source: trunk/modelicaml/org.openmodelica.modelicaml.modelexplorer/plugin.xml @ 1641

Last change on this file since 1641 was 1641, checked in by wschamai, 12 years ago

MOD: sync. actions added to model explorer pupup actions
NEW: create comment action

File size: 83.7 KB
Line 
1<?xml version="1.0" encoding="UTF-8"?>
2<?eclipse version="3.4"?>
3<plugin>
4      <extension-point id="actionHandler" name="actionHandler" schema="schema/org.eclipse.papyrus.views.modelexplorer.actionHandler.exsd"/>
5<extension
6      point="org.eclipse.emf.facet.infra.query.registration">
7   <modelqueryset
8         file="resources/ModelicaML.querySet">
9   </modelqueryset>
10</extension>
11  <extension
12         point="org.eclipse.emf.facet.infra.browser.custom.core.registration">
13      <browserCustomization
14            file="resources/ModelicaMLCustomization.uiCustom"
15            loadByDefault="true">
16      </browserCustomization>
17   </extension>
18   <extension point="org.eclipse.ui.views">
19      <view category="org.openmodelica.modelicaml.category" class="org.openmodelica.modelicaml.modelexplorer.ModelExplorerPageBookView" icon="icons/ModelicaML_logo_16x16.png" id="org.openmodelica.modelicaml.modelexplorer" name="Model Explorer" restorable="true">
20      </view>
21   </extension>
22   <extension point="org.eclipse.ui.navigator.viewer">
23      <viewer popupMenuId="org.openmodelica.modelicaml.modelexplorer.popup" viewerId="org.openmodelica.modelicaml.modelexplorer">
24      </viewer>
25      <viewerContentBinding viewerId="org.openmodelica.modelicaml.modelexplorer">
26         <includes>
27            <contentExtension pattern="org.eclipse.papyrus.views.modelexplorer.*">
28            </contentExtension>
29         </includes>
30      </viewerContentBinding>
31      <!--We add a drag assistant in order support drag and drop between Model Explorer and Table Editor or other View/editors -->
32      <dragAssistant class="org.eclipse.papyrus.views.modelexplorer.dnd.EObjectDragAdapterAssistant" viewerId="org.openmodelica.modelicaml.modelexplorer">
33      </dragAssistant>
34   </extension>
35   <extension point="org.eclipse.ui.navigator.navigatorContent">
36      <navigatorContent activeByDefault="false" contentProvider="org.eclipse.papyrus.views.modelexplorer.MoDiscoContentProvider" id="org.openmodelica.modelicaml.modelexplorer.navigatorContent" labelProvider="org.eclipse.papyrus.views.modelexplorer.MoDiscoLabelProvider" name="Model Contents" priority="lowest">
37         <triggerPoints>
38            <or>
39               <instanceof value="org.eclipse.emf.ecore.EObject">
40               </instanceof>
41               <adapt type="org.eclipse.emf.ecore.EObject">
42               </adapt>
43               <instanceof value="java.lang.Object">
44               </instanceof>
45            </or>
46         </triggerPoints>
47         <possibleChildren>
48            <or>
49               <instanceof value="org.eclipse.gmf.runtime.notation.impl.DiagramImpl">
50               </instanceof>
51               <instanceof value="org.eclipse.emf.facet.infra.browser.uicore.internal.model.ModelElementItem"/>
52            </or>
53         </possibleChildren>
54         <actionProvider class="org.eclipse.papyrus.views.modelexplorer.actionprovider.GenericTransformActionProvider" id="org.eclipse.papyrus.views.modelexplorer.actionprovider.GenericTransformActionProvider">
55            <enablement>
56               <or>
57                  <adapt type="org.eclipse.emf.ecore.EObject">
58                  </adapt>
59               </or>
60            </enablement>
61         </actionProvider>
62         
63         <actionProvider class="org.eclipse.papyrus.views.modelexplorer.actionprovider.EditingDomainActionProvider" id="org.eclipse.papyrus.views.modelexplorer.actionprovider.EditingDomainActionProvider">
64                  <enablement>
65               <and>
66                  <not>
67                     <instanceof value="org.eclipse.gmf.runtime.notation.Diagram">
68                     </instanceof>
69                  </not>
70                  <adapt type="org.eclipse.emf.ecore.EObject">
71                  </adapt>
72               </and>
73            </enablement>
74         </actionProvider>
75         <dropAssistant class="org.eclipse.papyrus.views.modelexplorer.dnd.CommonDropAdapterAssistant" id="org.eclipse.papyrus.views.modelexplorer.dnd.CommonDropAdapterAssistant">
76            <possibleDropTargets>
77               <or>
78                  <instanceof value="org.eclipse.gmf.runtime.notation.impl.DiagramImpl">
79                  </instanceof>
80                  <adapt type="org.eclipse.emf.ecore.EObject">
81                  </adapt>
82               </or>
83            </possibleDropTargets>
84         </dropAssistant>
85   
86      </navigatorContent>
87   </extension>
88   <extension
89         point="org.eclipse.ui.menus">
90      <menuContribution
91            allPopups="false"
92            locationURI="popup:org.openmodelica.modelicaml.modelexplorer.popup">
93         <separator
94               name="org.openmodelica.modelicaml.profile.separator1"
95               visible="true">
96         </separator>
97         <menu
98               icon="resources/icons/icons16/new.gif"
99               id="org.openmodelica.modelicaml.popup.newelement"
100               label="New Element">
101            <command
102                  commandId="org.openmodelica.modelicaml.commands.CreatePackageCommand"
103                  icon="resources/icons/papyrus/Package.gif"
104                  label="Package(s)"
105                  style="push">
106               <visibleWhen
107                     checkEnabled="true">
108               </visibleWhen>
109            </command>
110            <command
111                  commandId="org.openmodelica.modelicaml.commands.CreateClassDiagram"
112                  icon="resources/icons/papyrus/Diagram_Class.gif"
113                  label="Class Diagram"
114                  style="push">
115               <visibleWhen
116                     checkEnabled="true">
117               </visibleWhen>
118            </command>
119            <separator
120                  name="org.openmodelica.modelicaml.profile.separator1"
121                  visible="true">
122            </separator>
123            <command
124                  commandId="org.openmodelica.modelicaml.commands.CreateModelicaRequirementCommand"
125                  icon="resources/icons/icons16/requirement.gif"
126                  label="Requirement(s)"
127                  style="push">
128               <visibleWhen
129                     checkEnabled="true">
130                  <with
131                        variable="selection">
132                     <iterate
133                           ifEmpty="false"
134                           operator="or">
135                        <adapt
136                              type="org.eclipse.emf.ecore.EObject">
137                           <instanceof
138                                 value="org.eclipse.uml2.uml.Package">
139                           </instanceof>
140                        </adapt>
141                     </iterate>
142                     <count
143                           value="1">
144                     </count>
145                  </with>
146               </visibleWhen>
147            </command>
148            <command
149                  commandId="org.openmodelica.modelicaml.commands.CreateModelicaClassCommand"
150                  icon="resources/icons/icons16/model.gif"
151                  label="System Model(s)"
152                  style="push">
153               <visibleWhen
154                     checkEnabled="true">
155                  <with
156                        variable="selection">
157                     <iterate
158                           ifEmpty="false"
159                           operator="or">
160                        <adapt
161                              type="org.eclipse.emf.ecore.EObject">
162                           <instanceof
163                                 value="org.eclipse.uml2.uml.Package">
164                           </instanceof>
165                        </adapt>
166                     </iterate>
167                     <count
168                           value="1">
169                     </count>
170                  </with>
171               </visibleWhen>
172            </command>
173            <command
174                  commandId="org.openmodelica.modelicaml.commands.CreateModelicaConnectorCommand"
175                  icon="resources/icons/icons16/connector.gif"
176                  label="Interface Defintion(s)"
177                  style="push">
178               <visibleWhen
179                     checkEnabled="true">
180                  <with
181                        variable="selection">
182                     <iterate
183                           ifEmpty="false"
184                           operator="or">
185                        <adapt
186                              type="org.eclipse.emf.ecore.EObject">
187                           <instanceof
188                                 value="org.eclipse.uml2.uml.Package">
189                           </instanceof>
190                        </adapt>
191                     </iterate>
192                     <count
193                           value="1">
194                     </count>
195                  </with>
196               </visibleWhen>
197            </command>
198            <command
199                  commandId="org.openmodelica.modelicaml.commands.CreateModelicaCalculationModelCommand"
200                  icon="resources/icons/icons16/calculationModel.gif"
201                  label="Calculation Model(s)"
202                  style="push">
203               <visibleWhen
204                     checkEnabled="true">
205                  <with
206                        variable="selection">
207                     <iterate
208                           ifEmpty="false"
209                           operator="or">
210                        <adapt
211                              type="org.eclipse.emf.ecore.EObject">
212                           <instanceof
213                                 value="org.eclipse.uml2.uml.Package">
214                           </instanceof>
215                        </adapt>
216                     </iterate>
217                     <count
218                           value="1">
219                     </count>
220                  </with>
221               </visibleWhen>
222            </command>
223            <command
224                  commandId="org.openmodelica.modelicaml.commands.CreateTestScenarioCommand"
225                  icon="resources/icons/icons16/calculationModel.gif"
226                  label="Verification Scenario(s)"
227                  style="push"
228                  tooltip="Verification Scenario(s)">
229               <visibleWhen
230                     checkEnabled="true">
231                  <with
232                        variable="selection">
233                     <iterate
234                           ifEmpty="false"
235                           operator="or">
236                        <adapt
237                              type="org.eclipse.emf.ecore.EObject">
238                           <instanceof
239                                 value="org.eclipse.uml2.uml.Package">
240                           </instanceof>
241                        </adapt>
242                     </iterate>
243                     <count
244                           value="1">
245                     </count>
246                  </with>
247               </visibleWhen>
248            </command>
249            <command
250                  commandId="org.openmodelica.modelicaml.commands.CreateModelicaSimulationModelCommand"
251                  icon="resources/icons/icons16/model.gif"
252                  label="Simulation Model(s)"
253                  style="push">
254               <visibleWhen
255                     checkEnabled="true">
256                  <with
257                        variable="selection">
258                     <iterate
259                           ifEmpty="false"
260                           operator="or">
261                        <adapt
262                              type="org.eclipse.emf.ecore.EObject">
263                           <instanceof
264                                 value="org.eclipse.uml2.uml.Package">
265                           </instanceof>
266                        </adapt>
267                     </iterate>
268                     <count
269                           value="1">
270                     </count>
271                  </with>
272               </visibleWhen>
273            </command>
274            <separator
275                  name="org.openmodelica.modelicaml.profile.separator2"
276                  visible="true">
277            </separator>
278            <command
279                  commandId="org.openmodelica.modelicaml.commands.CreateValueMediatorsContainerCommand"
280                  icon="resources/icons/icons16/valueMediatorsContainer.png"
281                  label="Value Mediator Container"
282                  style="push"
283                  tooltip="Value Mediator Container">
284               <visibleWhen
285                     checkEnabled="true">
286                  <with
287                        variable="selection">
288                     <iterate
289                           ifEmpty="false"
290                           operator="or">
291                        <adapt
292                              type="org.eclipse.emf.ecore.EObject">
293                           <instanceof
294                                 value="org.eclipse.uml2.uml.Package">
295                           </instanceof>
296                        </adapt>
297                     </iterate>
298                     <count
299                           value="1">
300                     </count>
301                  </with>
302               </visibleWhen>
303            </command>
304            <command
305                  commandId="org.openmodelica.modelicaml.commands.CreateValueMediatorCommand"
306                  icon="resources/icons/icons16/valueMediator.png"
307                  label="Value Mediator"
308                  style="push">
309               <visibleWhen
310                     checkEnabled="true">
311                  <with
312                        variable="selection">
313                     <iterate
314                           ifEmpty="false"
315                           operator="or">
316                        <adapt
317                              type="org.eclipse.emf.ecore.EObject">
318                           <and>
319                              <test
320                                    args="ModelicaML::ValueBinding::ValueMediatorsContainer"
321                                    forcePluginActivation="true"
322                                    property="org.openmodelica.modelicaml.testers.hasStereotype">
323                              </test>
324                           </and>
325                        </adapt>
326                     </iterate>
327                     <count
328                           value="1">
329                     </count>
330                  </with>
331               </visibleWhen>
332            </command>
333            <separator
334                  name="org.openmodelica.modelicaml.profile.separator3"
335                  visible="true">
336            </separator>
337            <command
338                  commandId="org.openmodelica.modelicaml.commands.CreateModelicaRequirementInstanceCommand"
339                  icon="resources/icons/icons16/requirementInstance.png"
340                  label="Requirement Instance"
341                  style="push">
342               <visibleWhen
343                     checkEnabled="true">
344                  <with
345                        variable="selection">
346                     <iterate
347                           ifEmpty="false"
348                           operator="or">
349                        <adapt
350                              type="org.eclipse.emf.ecore.EObject">
351                           <test
352                                 args="ModelicaML::ModelicaSimulationConstructs::Simulation"
353                                 forcePluginActivation="true"
354                                 property="org.openmodelica.modelicaml.testers.hasStereotype">
355                           </test>
356                        </adapt>
357                     </iterate>
358                     <count
359                           value="1">
360                     </count>
361                  </with>
362               </visibleWhen>
363            </command>
364            <command
365                  commandId="org.openmodelica.modelicaml.commands.CreateModelicaFunctionArgumentCommand"
366                  icon="resources\icons\icons16\Parameter.gif"
367                  label="Function Argument"
368                  style="push">
369               <visibleWhen
370                     checkEnabled="true">
371               </visibleWhen>
372            </command>
373            <command
374                  commandId="org.openmodelica.modelicaml.commands.CreateModelicaVariableCommand"
375                  icon="resources/icons/icons16/variable.png"
376                  label="Variables (Primitive)"
377                  style="push">
378               <visibleWhen
379                     checkEnabled="true">
380               </visibleWhen>
381            </command>
382            <command
383                  commandId="org.openmodelica.modelicaml.commands.CreateModelicaEnumerationLiteralCommand"
384                  icon="resources/icons/icons16/EnumerationLiteral.gif"
385                  label="Enumeration Literal"
386                  style="push">
387               <visibleWhen
388                     checkEnabled="true">
389               </visibleWhen>
390            </command>
391            <separator
392                  name="org.openmodelica.modelicaml.profile.separator4"
393                  visible="true">
394            </separator>
395            <command
396                  commandId="org.openmodelica.modelicaml.commands.CreateModelicaComponentCommand"
397                  icon="resources/icons/icons16/component.png"
398                  label="Component (Model Usage)"
399                  style="push">
400               <visibleWhen
401                     checkEnabled="true">
402                  <with
403                        variable="selection">
404                     <iterate
405                           ifEmpty="false"
406                           operator="or">
407                        <adapt
408                              type="org.eclipse.emf.ecore.EObject">
409                           <or>
410                              <test
411                                    args="ModelicaML::ModelicaClassConstructs::ModelicaClass"
412                                    forcePluginActivation="true"
413                                    property="org.openmodelica.modelicaml.testers.hasStereotype">
414                              </test>
415                              <test
416                                    args="ModelicaML::ModelicaClassConstructs::Model"
417                                    forcePluginActivation="true"
418                                    property="org.openmodelica.modelicaml.testers.hasStereotype">
419                              </test>
420                              <test
421                                    args="ModelicaML::ModelicaClassConstructs::Block"
422                                    forcePluginActivation="true"
423                                    property="org.openmodelica.modelicaml.testers.hasStereotype">
424                              </test>
425                           </or>
426                        </adapt>
427                     </iterate>
428                     <count
429                           value="1">
430                     </count>
431                  </with>
432               </visibleWhen>
433            </command>
434            <command
435                  commandId="org.openmodelica.modelicaml.commands.CreateModelicaPortCommand"
436                  icon="resources/icons/papyrus/Port.gif"
437                  label="Port (Interface Usage)"
438                  style="push">
439               <visibleWhen
440                     checkEnabled="true">
441               </visibleWhen>
442            </command>
443            <command
444                  commandId="org.openmodelica.modelicaml.commands.CreateConnectionDiagram"
445                  icon="resources/icons/papyrus/Diagram_CompositeStructure.gif"
446                  label="Connection Diagram"
447                  style="push">
448               <visibleWhen
449                     checkEnabled="true">
450               </visibleWhen>
451            </command>
452            <separator
453                  name="org.openmodelica.modelicaml.profile.separator5"
454                  visible="true">
455            </separator>
456            <command
457                  commandId="org.openmodelica.modelicaml.commands.CreateModelicaCalculatedPropertyCommand"
458                  icon="resources/icons/icons16/calculatedProperty.png"
459                  label="Calculated Property (Calculation Model Usage)"
460                  style="push">
461               <visibleWhen
462                     checkEnabled="true">
463                  <with
464                        variable="selection">
465                     <iterate
466                           ifEmpty="false"
467                           operator="or">
468                        <adapt
469                              type="org.eclipse.emf.ecore.EObject">
470                           <not>
471                              <test
472                                    args="ModelicaML::ValueBinding::ValueMediatorsContainer"
473                                    forcePluginActivation="true"
474                                    property="org.openmodelica.modelicaml.testers.hasStereotype">
475                              </test>
476                           </not>
477                        </adapt>
478                     </iterate>
479                     <count
480                           value="1">
481                     </count>
482                  </with>
483               </visibleWhen>
484            </command>
485            <separator
486                  name="org.openmodelica.modelicaml.profile.separator6"
487                  visible="true">
488            </separator>
489            <menu
490                  label="Modelica Classes">
491               <command
492                     commandId="org.openmodelica.modelicaml.commands.CreateModelicaPackageCommand"
493                     icon="resources/icons/icons16/package.gif"
494                     label="Modelica Package"
495                     style="push">
496                  <visibleWhen
497                        checkEnabled="true">
498                  </visibleWhen>
499               </command>
500               <command
501                     commandId="org.openmodelica.modelicaml.commands.CreateModelicaOperatorCommand"
502                     icon="resources/icons/icons16/operator.gif"
503                     label="Operator"
504                     style="push">
505                  <visibleWhen
506                        checkEnabled="true">
507                  </visibleWhen>
508               </command>
509               <command
510                     commandId="org.openmodelica.modelicaml.commands.CreateModelicaModelCommand"
511                     icon="resources/icons/icons16/model.gif"
512                     label="Model"
513                     style="push">
514                  <visibleWhen
515                        checkEnabled="true">
516                  </visibleWhen>
517               </command>
518               <command
519                     commandId="org.openmodelica.modelicaml.commands.CreateModelicaBlockCommand"
520                     icon="resources/icons/icons16/block.gif"
521                     label="Block"
522                     style="push">
523                  <visibleWhen
524                        checkEnabled="true">
525                  </visibleWhen>
526               </command>
527               <command
528                     commandId="org.openmodelica.modelicaml.commands.CreateModelicaConnectorCommand"
529                     icon="resources/icons/icons16/connector.gif"
530                     label="Connector"
531                     style="push">
532                  <visibleWhen
533                        checkEnabled="true">
534                  </visibleWhen>
535               </command>
536               <command
537                     commandId="org.openmodelica.modelicaml.commands.CreateModelicaRecordCommand"
538                     icon="resources/icons/icons16/record.gif"
539                     label="Record"
540                     style="push">
541                  <visibleWhen
542                        checkEnabled="true">
543                  </visibleWhen>
544               </command>
545               <command
546                     commandId="org.openmodelica.modelicaml.commands.CreateModelicaFunctionCommand"
547                     icon="resources/icons/papyrus/FunctionBehavior.gif"
548                     label="Function"
549                     style="push">
550                  <visibleWhen
551                        checkEnabled="true">
552                  </visibleWhen>
553               </command>
554               <command
555                     commandId="org.openmodelica.modelicaml.commands.CreateModelicaTypeCommand"
556                     icon="resources/icons/icons16/type.gif"
557                     label="Type"
558                     style="push">
559                  <visibleWhen
560                        checkEnabled="true">
561                  </visibleWhen>
562               </command>
563               <command
564                     commandId="org.openmodelica.modelicaml.commands.CreateModelicaEnumerationCommand"
565                     icon="resources/icons/papyrus/Enumeration.gif"
566                     label="Enumeration"
567                     style="push">
568                  <visibleWhen
569                        checkEnabled="true">
570                  </visibleWhen>
571               </command>
572               <visibleWhen
573                     checkEnabled="false">
574                  <with
575                        variable="selection">
576                     <iterate
577                           ifEmpty="false"
578                           operator="or">
579                        <adapt
580                              type="org.eclipse.emf.ecore.EObject">
581                           <instanceof
582                                 value="org.eclipse.uml2.uml.Package">
583                           </instanceof>
584                        </adapt>
585                     </iterate>
586                     <count
587                           value="1">
588                     </count>
589                  </with>
590               </visibleWhen>
591            </menu>
592            <separator
593                  name="org.openmodelica.modelicaml.profile.separator7"
594                  visible="true">
595            </separator>
596            <command
597                  commandId="org.openmodelica.modelicaml.commands.CreateModelicaAlgorithmCommand"
598                  icon="resources/icons/papyrus/OpaqueBehavior.gif"
599                  label="Algorithm Section"
600                  style="push"
601                  tooltip="Algorithm Section">
602               <visibleWhen
603                     checkEnabled="true">
604                  <with
605                        variable="selection">
606                     <iterate
607                           ifEmpty="false"
608                           operator="or">
609                        <adapt
610                              type="org.eclipse.emf.ecore.EObject">
611                           <not>
612                              <test
613                                    args="ModelicaML::ValueBinding::ValueMediatorsContainer"
614                                    forcePluginActivation="true"
615                                    property="org.openmodelica.modelicaml.testers.hasStereotype">
616                              </test>
617                           </not>
618                        </adapt>
619                     </iterate>
620                     <count
621                           value="1">
622                     </count>
623                  </with>
624               </visibleWhen>
625            </command>
626            <command
627                  commandId="org.openmodelica.modelicaml.commands.CreateModelicaEquationsCodeCommand"
628                  icon="resources/icons/papyrus/OpaqueBehavior.gif"
629                  label="Equation Section"
630                  style="push"
631                  tooltip="Equation Section">
632               <visibleWhen
633                     checkEnabled="true">
634                  <with
635                        variable="selection">
636                     <iterate
637                           ifEmpty="false"
638                           operator="or">
639                        <adapt
640                              type="org.eclipse.emf.ecore.EObject">
641                           <not>
642                              <test
643                                    args="ModelicaML::ValueBinding::ValueMediatorsContainer"
644                                    forcePluginActivation="true"
645                                    property="org.openmodelica.modelicaml.testers.hasStereotype">
646                              </test>
647                           </not>
648                        </adapt>
649                     </iterate>
650                     <count
651                           value="1">
652                     </count>
653                  </with>
654               </visibleWhen>
655            </command>
656            <command
657                  commandId="org.openmodelica.modelicaml.commands.CreateStateMachineDiagram"
658                  icon="resources/icons/papyrus/Diagram_StateMachine.gif"
659                  label="State Machine"
660                  style="push">
661               <visibleWhen
662                     checkEnabled="true">
663               </visibleWhen>
664            </command>
665            <separator
666                  name="org.openmodelica.modelicaml.profile.separator8"
667                  visible="true">
668            </separator>
669            <command
670                  commandId="org.openmodelica.modelicaml.commands.CreateModelicaAssertCommand"
671                  icon="resources/icons/papyrus/Constraint.gif"
672                  label="Assert"
673                  style="push">
674               <visibleWhen
675                     checkEnabled="true">
676               </visibleWhen>
677            </command>
678            <separator
679                  name="org.openmodelica.modelicaml.profile.separator9"
680                  visible="true">
681            </separator>
682            <command
683                  commandId="org.openmodelica.modelicaml.commands.CreateModelicaAnnotationCommand"
684                  icon="resources/icons/papyrus/Comment.gif"
685                  label="Annotation"
686                  style="push">
687               <visibleWhen
688                     checkEnabled="true">
689               </visibleWhen>
690            </command>
691            <command
692                  commandId="org.openmodelica.modelicaml.commands.CreateCommentCommand"
693                  icon="resources/icons/papyrus/Comment.gif"
694                  label="Comment"
695                  style="push">
696               <visibleWhen
697                     checkEnabled="true">
698               </visibleWhen>
699            </command>
700            <separator
701                  name="org.openmodelica.modelicaml.profile.separator10"
702                  visible="true">
703            </separator>
704            <menu
705                  label="Nested Classes">
706               <command
707                     commandId="org.openmodelica.modelicaml.commands.CreateModelicaRequirementCommand"
708                     icon="resources/icons/icons16/requirement.gif"
709                     label="Requirement(s)"
710                     style="push">
711                  <visibleWhen
712                        checkEnabled="true">
713                  </visibleWhen>
714               </command>
715               <command
716                     commandId="org.openmodelica.modelicaml.commands.CreateModelicaClassCommand"
717                     icon="resources/icons/icons16/model.gif"
718                     label="System Model(s)"
719                     style="push">
720                  <visibleWhen
721                        checkEnabled="true">
722                     <with
723                           variable="selection">
724                        <iterate
725                              ifEmpty="false"
726                              operator="or">
727                           <adapt
728                                 type="org.eclipse.emf.ecore.EObject">
729                              <or>
730                                 <test
731                                       args="ModelicaML::ModelicaClassConstructs::ModelicaClass"
732                                       forcePluginActivation="true"
733                                       property="org.openmodelica.modelicaml.testers.hasStereotype">
734                                 </test>
735                                 <test
736                                       args="ModelicaML::ModelicaClassConstructs::ModelicaClass"
737                                       forcePluginActivation="true"
738                                       property="org.openmodelica.modelicaml.testers.hasStereotype">
739                                 </test>
740                                 <test
741                                       args="ModelicaML::ModelicaClassConstructs::Model"
742                                       forcePluginActivation="true"
743                                       property="org.openmodelica.modelicaml.testers.hasStereotype">
744                                 </test>
745                                 <test
746                                       args="ModelicaML::ModelicaClassConstructs::Block"
747                                       forcePluginActivation="true"
748                                       property="org.openmodelica.modelicaml.testers.hasStereotype">
749                                 </test>
750                              </or>
751                           </adapt>
752                        </iterate>
753                        <count
754                              value="1">
755                        </count>
756                     </with>
757                  </visibleWhen>
758               </command>
759               <command
760                     commandId="org.openmodelica.modelicaml.commands.CreateModelicaConnectorCommand"
761                     icon="resources/icons/icons16/connector.gif"
762                     label="Interface Defintion(s)"
763                     style="push">
764                  <visibleWhen
765                        checkEnabled="true">
766                     <with
767                           variable="selection">
768                        <iterate
769                              ifEmpty="false"
770                              operator="or">
771                           <adapt
772                                 type="org.eclipse.emf.ecore.EObject">
773                              <or>
774                                 <test
775                                       args="ModelicaML::ModelicaClassConstructs::ModelicaClass"
776                                       forcePluginActivation="true"
777                                       property="org.openmodelica.modelicaml.testers.hasStereotype">
778                                 </test>
779                                 <test
780                                       args="ModelicaML::ModelicaClassConstructs::ModelicaClass"
781                                       forcePluginActivation="true"
782                                       property="org.openmodelica.modelicaml.testers.hasStereotype">
783                                 </test>
784                                 <test
785                                       args="ModelicaML::ModelicaClassConstructs::Model"
786                                       forcePluginActivation="true"
787                                       property="org.openmodelica.modelicaml.testers.hasStereotype">
788                                 </test>
789                                 <test
790                                       args="ModelicaML::ModelicaClassConstructs::Block"
791                                       forcePluginActivation="true"
792                                       property="org.openmodelica.modelicaml.testers.hasStereotype">
793                                 </test>
794                              </or>
795                           </adapt>
796                        </iterate>
797                        <count
798                              value="1">
799                        </count>
800                     </with>
801                  </visibleWhen>
802               </command>
803               <command
804                     commandId="org.openmodelica.modelicaml.commands.CreateModelicaCalculationModelCommand"
805                     icon="resources/icons/icons16/calculationModel.gif"
806                     label="Calculation Model(s)"
807                     style="push">
808                  <visibleWhen
809                        checkEnabled="true">
810                  </visibleWhen>
811               </command>
812               <command
813                     commandId="org.openmodelica.modelicaml.commands.CreateModelicaSimulationModelCommand"
814                     icon="resources/icons/icons16/model.gif"
815                     label="Simulation Model(s)"
816                     style="push">
817                  <visibleWhen
818                        checkEnabled="true">
819                     <with
820                           variable="selection">
821                        <iterate
822                              ifEmpty="false"
823                              operator="or">
824                           <adapt
825                                 type="org.eclipse.emf.ecore.EObject">
826                              <or>
827                                 <test
828                                       args="ModelicaML::ModelicaClassConstructs::ModelicaClass"
829                                       forcePluginActivation="true"
830                                       property="org.openmodelica.modelicaml.testers.hasStereotype">
831                                 </test>
832                                 <test
833                                       args="ModelicaML::ModelicaClassConstructs::ModelicaClass"
834                                       forcePluginActivation="true"
835                                       property="org.openmodelica.modelicaml.testers.hasStereotype">
836                                 </test>
837                                 <test
838                                       args="ModelicaML::ModelicaClassConstructs::Model"
839                                       forcePluginActivation="true"
840                                       property="org.openmodelica.modelicaml.testers.hasStereotype">
841                                 </test>
842                                 <test
843                                       args="ModelicaML::ModelicaClassConstructs::Block"
844                                       forcePluginActivation="true"
845                                       property="org.openmodelica.modelicaml.testers.hasStereotype">
846                                 </test>
847                              </or>
848                           </adapt>
849                        </iterate>
850                        <count
851                              value="1">
852                        </count>
853                     </with>
854                  </visibleWhen>
855               </command>
856               <menu
857                     label="Modelica Classes">
858                  <command
859                        commandId="org.openmodelica.modelicaml.commands.CreateModelicaPackageCommand"
860                        icon="resources/icons/icons16/package.gif"
861                        label="Modelica Package"
862                        style="push">
863                     <visibleWhen
864                           checkEnabled="true">
865                     </visibleWhen>
866                  </command>
867                  <command
868                        commandId="org.openmodelica.modelicaml.commands.CreateModelicaOperatorCommand"
869                        icon="resources/icons/icons16/operator.gif"
870                        label="Operator"
871                        style="push">
872                     <visibleWhen
873                           checkEnabled="true">
874                     </visibleWhen>
875                  </command>
876                  <command
877                        commandId="org.openmodelica.modelicaml.commands.CreateModelicaModelCommand"
878                        icon="resources/icons/icons16/model.gif"
879                        label="Model"
880                        style="push">
881                     <visibleWhen
882                           checkEnabled="true">
883                     </visibleWhen>
884                  </command>
885                  <command
886                        commandId="org.openmodelica.modelicaml.commands.CreateModelicaBlockCommand"
887                        icon="resources/icons/icons16/block.gif"
888                        label="Block"
889                        style="push">
890                     <visibleWhen
891                           checkEnabled="true">
892                     </visibleWhen>
893                  </command>
894                  <command
895                        commandId="org.openmodelica.modelicaml.commands.CreateModelicaConnectorCommand"
896                        icon="resources/icons/icons16/connector.gif"
897                        label="Connector"
898                        style="push">
899                     <visibleWhen
900                           checkEnabled="true">
901                     </visibleWhen>
902                  </command>
903                  <command
904                        commandId="org.openmodelica.modelicaml.commands.CreateModelicaRecordCommand"
905                        icon="resources/icons/icons16/record.gif"
906                        label="Record"
907                        style="push">
908                     <visibleWhen
909                           checkEnabled="true">
910                     </visibleWhen>
911                  </command>
912                  <command
913                        commandId="org.openmodelica.modelicaml.commands.CreateModelicaFunctionCommand"
914                        icon="resources/icons/papyrus/FunctionBehavior.gif"
915                        label="Function"
916                        style="push">
917                     <visibleWhen
918                           checkEnabled="true">
919                     </visibleWhen>
920                  </command>
921                  <command
922                        commandId="org.openmodelica.modelicaml.commands.CreateModelicaTypeCommand"
923                        icon="resources/icons/icons16/type.gif"
924                        label="Type"
925                        style="push">
926                     <visibleWhen
927                           checkEnabled="true">
928                     </visibleWhen>
929                  </command>
930                  <command
931                        commandId="org.openmodelica.modelicaml.commands.CreateModelicaEnumerationCommand"
932                        icon="resources/icons/papyrus/Enumeration.gif"
933                        label="Enumeration"
934                        style="push">
935                     <visibleWhen
936                           checkEnabled="true">
937                     </visibleWhen>
938                  </command>
939               </menu>
940               <visibleWhen
941                     checkEnabled="false">
942                  <with
943                        variable="selection">
944                     <iterate
945                           ifEmpty="false"
946                           operator="or">
947                        <adapt
948                              type="org.eclipse.emf.ecore.EObject">
949                           <not>
950                              <test
951                                    args="ModelicaML::ModelicaClassConstructs::Function"
952                                    forcePluginActivation="true"
953                                    property="org.openmodelica.modelicaml.testers.hasStereotype">
954                              </test>
955                           </not>
956                           <and>
957                              <or>
958                                 <instanceof
959                                       value="org.eclipse.uml2.uml.Class">
960                                 </instanceof>
961                              </or>
962                           </and>
963                           <not>
964                              <instanceof
965                                    value="org.eclipse.uml2.uml.Behavior">
966                              </instanceof>
967                           </not>
968                           <not>
969                              <instanceof
970                                    value="org.eclipse.uml2.uml.Package">
971                              </instanceof>
972                           </not>
973                           <not>
974                              <test
975                                    args="ModelicaML::ValueBinding::ValueMediatorsContainer"
976                                    forcePluginActivation="true"
977                                    property="org.openmodelica.modelicaml.testers.hasStereotype">
978                              </test>
979                           </not>
980                        </adapt>
981                     </iterate>
982                     <count
983                           value="1">
984                     </count>
985                  </with>
986               </visibleWhen>
987            </menu>
988            <visibleWhen
989                  checkEnabled="false">
990               <with
991                     variable="activeWorkbenchWindow.activePerspective">
992                  <equals
993                        value="org.openmodelica.modelicaml.perspective">
994                  </equals>
995               </with>
996            </visibleWhen>
997         </menu>
998         <menu
999               icon="resources/icons/icons16/newDiagram.gif"
1000               id="org.openmodelica.modelicaml.popup.newdiagram"
1001               label="New Diagram">
1002            <command
1003                  commandId="org.openmodelica.modelicaml.commands.CreateClassDiagram"
1004                  icon="resources/icons/papyrus/Diagram_Class.gif"
1005                  label="Class Diagram"
1006                  style="push">
1007               <visibleWhen
1008                     checkEnabled="true">
1009               </visibleWhen>
1010            </command>
1011            <command
1012                  commandId="org.openmodelica.modelicaml.commands.CreateConnectionDiagram"
1013                  icon="resources/icons/papyrus/Diagram_CompositeStructure.gif"
1014                  label="Connection Diagram"
1015                  style="push">
1016               <visibleWhen
1017                     checkEnabled="true">
1018               </visibleWhen>
1019            </command>
1020            <command
1021                  commandId="org.openmodelica.modelicaml.commands.CreateStateMachineDiagram"
1022                  icon="resources/icons/papyrus/Diagram_StateMachine.gif"
1023                  label="State Machine Diagram"
1024                  style="push">
1025               <visibleWhen
1026                     checkEnabled="true">
1027               </visibleWhen>
1028            </command>
1029            <visibleWhen
1030                  checkEnabled="false">
1031               <with
1032                     variable="activeWorkbenchWindow.activePerspective">
1033                  <equals
1034                        value="org.openmodelica.modelicaml.perspective">
1035                  </equals>
1036               </with>
1037            </visibleWhen>
1038         </menu>
1039         <command
1040               commandId="org.openmodelica.modelicaml.commands.deleteTopLevelModelPackage"
1041               icon="resources/icons/icons16/delete.gif"
1042               label="Delete top-level model"
1043               style="push">
1044            <visibleWhen
1045                  checkEnabled="true">
1046               <with
1047                     variable="selection">
1048                  <iterate
1049                        ifEmpty="false"
1050                        operator="or">
1051                     <adapt
1052                           type="org.eclipse.emf.ecore.EObject">
1053                        <instanceof
1054                              value="org.eclipse.uml2.uml.Model">
1055                        </instanceof>
1056                     </adapt>
1057                  </iterate>
1058                  <count
1059                        value="1">
1060                  </count>
1061               </with>
1062            </visibleWhen>
1063         </command>
1064      </menuContribution>
1065   </extension>
1066   <extension
1067         point="org.eclipse.ui.menus">
1068      <menuContribution
1069            allPopups="false"
1070            locationURI="popup:org.openmodelica.modelicaml.modelexplorer.popup">
1071         <separator
1072               name="org.openmodelica.modelicaml.modelexplorer.separator2"
1073               visible="true">
1074         </separator>
1075         <command
1076               commandId="org.openmodelica.modelicaml.modelexplorer.locate"
1077               icon="icons/editor/ModelExplorer.png"
1078               label="Locate"
1079               style="push">
1080         </command>
1081      </menuContribution>
1082   </extension>
1083   <!--
1084   <extension
1085         point="org.eclipse.ui.menus">
1086      <menuContribution
1087            allPopups="false"
1088            locationURI="popup:org.openmodelica.modelicaml.modelexplorer.popup">
1089         <separator
1090               name="org.openmodelica.modelicaml.profile.separator3"
1091               visible="true">
1092         </separator>
1093         <menu
1094               icon="resources/icons/icons16/invocation.gif"
1095               id="org.openmodelica.modelicaml.popup.helpers"
1096               label="Helper">
1097            <visibleWhen
1098                  checkEnabled="false">
1099               <with
1100                     variable="activeWorkbenchWindow.activePerspective">
1101                  <equals
1102                        value="org.openmodelica.modelicaml.perspective">
1103                  </equals>
1104               </with>
1105            </visibleWhen>
1106            <separator
1107                  name="org.openmodelica.modelicaml.helper.separator1"
1108                  visible="true">
1109            </separator>
1110            <command
1111                  commandId="org.openmodelica.modelicaml.helper.commands.generatesimmodels"
1112                  icon="resources/icons/icons16/new_testsuite.gif"
1113                  label="Generate Design Verification Models"
1114                  style="push"
1115                  tooltip="Generate Design Verification Models">
1116               <visibleWhen
1117                     checkEnabled="true">
1118               </visibleWhen>
1119            </command>
1120            <separator
1121                  name="org.openmodelica.modelicaml.helper.separator2"
1122                  visible="true">
1123            </separator>
1124         </menu>
1125      </menuContribution>
1126   </extension>
1127   -->
1128<extension
1129      point="org.eclipse.ui.menus">
1130   <menuContribution
1131         locationURI="popup:org.openmodelica.modelicaml.modelexplorer.popup">
1132      <separator
1133            name="org.openmodelica.modelicaml.modelexplorer.separator4"
1134            visible="true">
1135      </separator>
1136      <menu
1137            icon="icons/import_wiz_16x16-papyrusColor.gif"
1138            id="org.eclipse.papyrus.uml.import.menu"
1139            label="&amp;Import"
1140            tooltip="Papyrus Import Menu">
1141         
1142         <!--
1143         <command
1144               commandId="org.eclipse.papyrus.import.registered.profile"
1145               icon="platform:/plugin/org.eclipse.uml2.uml.edit/icons/full/obj16/Profile.gif"
1146               label="Import &amp;Registered Profile"
1147               style="push">
1148         </command>
1149         <command
1150               commandId="org.eclipse.papyrus.import.registered.package"
1151               icon="platform:/plugin/org.eclipse.uml2.uml.edit/icons/full/obj16/Package.gif"
1152               label="Import Registered &amp;Package"
1153               style="push">
1154         </command>
1155         <command
1156               commandId="org.eclipse.papyrus.import.package.from.workspace"
1157               icon="platform:/plugin/org.eclipse.uml2.uml.edit/icons/full/obj16/Package.gif"
1158               label="Import Package From &amp;Workspace"
1159               style="push">
1160         </command>
1161         -->
1162      </menu>
1163   </menuContribution>
1164</extension>
1165<extension
1166      point="org.eclipse.ui.menus">
1167   <menuContribution
1168         locationURI="popup:org.openmodelica.modelicaml.modelexplorer.popup">
1169      <separator
1170            name="org.openmodelica.modelicaml.modelexplorer.separator41"
1171            visible="true">
1172      </separator>
1173      <command
1174            commandId="org.openmodelica.modelicaml.relations.findReferences"
1175            icon="icons/search_references.gif"
1176            label="Find references"
1177            style="push">
1178         <visibleWhen
1179               checkEnabled="true">
1180            <with
1181                  variable="selection">
1182               <count
1183                     value="1">
1184               </count>
1185               <iterate>
1186                  <adapt
1187                        type="org.eclipse.emf.ecore.EObject">
1188                     <or>
1189                        <instanceof
1190                              value="org.eclipse.uml2.uml.Package">
1191                        </instanceof>
1192                        <instanceof
1193                              value="org.eclipse.uml2.uml.Model">
1194                        </instanceof>
1195                        <instanceof
1196                              value="org.eclipse.uml2.uml.Property">
1197                        </instanceof>
1198                        <instanceof
1199                              value="org.eclipse.uml2.uml.StateMachine">
1200                        </instanceof>
1201                        <instanceof
1202                              value="org.eclipse.uml2.uml.State">
1203                        </instanceof>
1204                        <instanceof
1205                              value="org.eclipse.uml2.uml.Class">
1206                        </instanceof>
1207                        <instanceof
1208                              value="org.eclipse.uml2.uml.PrimitiveType">
1209                        </instanceof>
1210                     </or>
1211                     <and>
1212                        <not>
1213                           <instanceof
1214                                 value="org.eclipse.uml2.uml.OpaqueAction">
1215                           </instanceof>
1216                        </not>
1217                        <not>
1218                           <instanceof
1219                                 value="org.eclipse.uml2.uml.OpaqueBehavior">
1220                           </instanceof>
1221                        </not>
1222                     </and>
1223                  </adapt>
1224               </iterate>
1225            </with>
1226         </visibleWhen>
1227      </command>
1228   </menuContribution>
1229</extension>
1230   <extension
1231         point="org.eclipse.ui.menus">
1232      <menuContribution
1233            allPopups="false"
1234            locationURI="popup:org.openmodelica.modelicaml.modelexplorer.popup">
1235         <separator
1236               name="org.openmodelica.modelicaml.profile.separator5"
1237               visible="true">
1238         </separator>
1239         <menu
1240               icon="icons/validate.gif"
1241               label="Validation and Code Generation">
1242            <command
1243                  commandId="org.openmodelica.modelicaml.validation.subtree"
1244                  icon="icons/validate.gif"
1245                  label="Validate sub-tree"
1246                  style="push"
1247                  tooltip="Validate sub-tree">
1248               <visibleWhen
1249                     checkEnabled="true">
1250                  <with
1251                        variable="selection">
1252                     <count
1253                           value="1">
1254                     </count>
1255                     <iterate>
1256                        <adapt
1257                              type="org.eclipse.emf.ecore.EObject">
1258                           <or>
1259                              <instanceof
1260                                    value="org.eclipse.uml2.uml.Package">
1261                              </instanceof>
1262                              <instanceof
1263                                    value="org.eclipse.uml2.uml.Class">
1264                              </instanceof>
1265                           </or>
1266                        </adapt>
1267                     </iterate>
1268                  </with>
1269               </visibleWhen>
1270            </command>
1271           
1272           <!-- TODO: the Papyrus command does not work. Enable again after fix. 
1273            <command
1274                  commandId="org.eclipse.papyrus.validation.ValidateDelMarkersFromSubtreeCommand"
1275                  icon="resources/icons/icons16/errorwarning_tab.gif"
1276                  id="org.eclipse.papyrus.validation.ValidateDelMarkersFromSubtreeCommand"
1277                  label="Remove markers from sub-tree"
1278                  tooltip="Remove markers from sub-tree">
1279               <visibleWhen
1280                     checkEnabled="true">
1281                  <with
1282                        variable="selection">
1283                     <count
1284                           value="1">
1285                     </count>
1286                     <iterate>
1287                        <adapt
1288                              type="org.eclipse.emf.ecore.EObject">
1289                        </adapt>
1290                     </iterate>
1291                  </with>
1292               </visibleWhen>
1293            </command>
1294            -->
1295            <command
1296                  commandId="org.eclipse.papyrus.validation.ValidateDelMarkersFromModelCommand"
1297                  icon="resources/icons/icons16/errorwarning_tab.gif"
1298                  id="org.eclipse.papyrus.validation.ValidateDelMarkersFromModelCommand"
1299                  label="Remove all model markers"
1300                  tooltip="Remove markers from sub-tree">
1301               <visibleWhen
1302                     checkEnabled="true">
1303                  <with
1304                        variable="selection">
1305                     <count
1306                           value="1">
1307                     </count>
1308                     <iterate>
1309                        <adapt
1310                              type="org.eclipse.emf.ecore.EObject">
1311                           <and>
1312                              <instanceof
1313                                    value="org.eclipse.uml2.uml.Model">
1314                              </instanceof>
1315                           </and>
1316                        </adapt>
1317                     </iterate>
1318                  </with>
1319               </visibleWhen>
1320            </command>
1321            <command
1322                  commandId="org.openmodelica.modelicaml.gen.modelica.commands.GenerateModelicaCodeFromThisElement"
1323                  icon="resources/icons/icons16/generate_code.gif"
1324                  label="Generate Modelica code (from sub-tree)"
1325                  style="push"
1326                  tooltip="Generate Modelica code (from sub-tree)">
1327               <visibleWhen
1328                     checkEnabled="true">
1329                  <with
1330                        variable="selection">
1331                     <count
1332                           value="1">
1333                     </count>
1334                     <iterate>
1335                        <adapt
1336                                type="org.eclipse.emf.ecore.EObject">
1337                             <or>
1338                                <instanceof
1339                                      value="org.eclipse.uml2.uml.Package">
1340                                </instanceof>
1341                                <instanceof
1342                                      value="org.eclipse.uml2.uml.Model">
1343                                </instanceof>
1344                                <and>
1345                                   <instanceof
1346                                         value="org.eclipse.uml2.uml.Class">
1347                                   </instanceof>
1348                                   <not>
1349                                      <instanceof
1350                                            value="org.eclipse.uml2.uml.Behavior">
1351                                      </instanceof>
1352                                   </not>
1353                                   <not>
1354                                      <instanceof
1355                                            value="org.eclipse.uml2.uml.StateMachine">
1356                                      </instanceof>
1357                                   </not>
1358                                </and>
1359                             </or>
1360                          </adapt>
1361                     </iterate>
1362                  </with>
1363               </visibleWhen>
1364            </command>
1365            <visibleWhen
1366                  checkEnabled="false">
1367               <with
1368                     variable="activeWorkbenchWindow.activePerspective">
1369                  <equals
1370                        value="org.openmodelica.modelicaml.perspective">
1371                  </equals>
1372               </with>
1373            </visibleWhen>
1374         </menu>
1375      </menuContribution>
1376   </extension>
1377   <extension
1378         point="org.eclipse.ui.menus">
1379      <menuContribution
1380            allPopups="false"
1381            locationURI="popup:org.openmodelica.modelicaml.modelexplorer.popup">
1382         <separator
1383               name="org.openmodelica.modelicaml.profile.separator6"
1384               visible="true">
1385         </separator>
1386         <menu
1387               icon="resources/icons/timeline_marker.png"
1388               id="org.openmodelica.modelicaml.popup.simulation"
1389               label="Simulation">
1390            <command
1391                  commandId="org.openmodelica.modelicaml.simulation.commands.CGAndSimulateThisClassWithOMC"
1392                  icon="resources/icons/timeline_marker.png"
1393                  label="Simulate with OMC"
1394                  style="push"
1395                  tooltip="Open in OMC Simulation Center">
1396               <visibleWhen
1397                     checkEnabled="true">
1398                  <with
1399                        variable="selection">
1400                     <count
1401                           value="1">
1402                     </count>
1403                     <iterate>
1404                        <adapt
1405                              type="org.eclipse.emf.ecore.EObject">
1406                           <or>
1407                              <instanceof
1408                                    value="org.eclipse.uml2.uml.Package">
1409                              </instanceof>
1410                              <instanceof
1411                                    value="org.eclipse.uml2.uml.Class">
1412                              </instanceof>
1413                           </or>
1414                        </adapt>
1415                     </iterate>
1416                  </with>
1417               </visibleWhen>
1418            </command>
1419            <visibleWhen
1420                  checkEnabled="false">
1421               <with
1422                     variable="activeWorkbenchWindow.activePerspective">
1423                  <equals
1424                        value="org.openmodelica.modelicaml.perspective">
1425                  </equals>
1426               </with>
1427            </visibleWhen>
1428         </menu>
1429         <separator
1430               name="org.openmodelica.modelicaml.modelexplorer.separator7"
1431               visible="true">
1432         </separator>
1433      </menuContribution>
1434   </extension>
1435   <extension
1436         point="org.eclipse.ui.menus">
1437      <menuContribution
1438            allPopups="false"
1439            locationURI="popup:org.openmodelica.modelicaml.modelexplorer.popup">
1440         <separator
1441               name="org.openmodelica.modelicaml.modelica.importer.separator1"
1442               visible="true">
1443         </separator>
1444         <menu
1445               icon="icons/code2.png"
1446               label="ModelicaML: Modelica Models Synchronization">
1447            <command
1448                  commandId="org.openmodelica.modelicaml.modelica.commands.disconnectfromcodesync"
1449                  icon="icons/launch_disconnect.gif"
1450                  style="push">
1451            </command>
1452            <command
1453                  commandId="org.openmodelica.modelicaml.modelica.commands.connecttocodesync"
1454                  icon="icons/connect_co.gif"
1455                  style="push">
1456            </command>
1457            <visibleWhen
1458                  checkEnabled="false">
1459               <with
1460                     variable="activeWorkbenchWindow.activePerspective">
1461                  <equals
1462                        value="org.openmodelica.modelicaml.perspective">
1463                  </equals>
1464                  <and>
1465                     <with
1466                           variable="selection">
1467                        <count
1468                              value="1">
1469                        </count>
1470                        <iterate>
1471                           <adapt
1472                                 type="org.eclipse.emf.ecore.EObject">
1473                              <and>
1474                                 <or>
1475                                    <test
1476                                          args="ModelicaML::ModelReferences::ModelicaModelProxy"
1477                                          property="org.openmodelica.modelicaml.testers.hasStereotype">
1478                                    </test>
1479                                    <instanceof
1480                                          value="org.eclipse.uml2.uml.Class">
1481                                    </instanceof>
1482                                    <instanceof
1483                                          value="org.eclipse.uml2.uml.Package">
1484                                    </instanceof>
1485                                    <test
1486                                          args="ModelicaML::ModelicaClassConstructs::Block"
1487                                          property="org.openmodelica.modelicaml.testers.hasStereotype">
1488                                    </test>
1489                                    <test
1490                                          args="ModelicaML::ModelicaClassConstructs::Model"
1491                                          property="org.openmodelica.modelicaml.testers.hasStereotype">
1492                                    </test>
1493                                    <test
1494                                          args="ModelicaML::ModelicaClassConstructs::ModelicaClass"
1495                                          property="org.openmodelica.modelicaml.testers.hasStereotype">
1496                                    </test>
1497                                    <test
1498                                          args="ModelicaML::ModelicaClassConstructs::ModelicaPackage"
1499                                          property="org.openmodelica.modelicaml.testers.hasStereotype">
1500                                    </test>
1501                                    <test
1502                                          args="ModelicaML::ModelicaClassConstructs::Function"
1503                                          property="org.openmodelica.modelicaml.testers.hasStereotype">
1504                                    </test>
1505                                    <test
1506                                          args="ModelicaML::ModelicaClassConstructs::Connector"
1507                                          property="org.openmodelica.modelicaml.testers.hasStereotype">
1508                                    </test>
1509                                    <test
1510                                          args="ModelicaML::ModelicaClassConstructs::Record"
1511                                          property="org.openmodelica.modelicaml.testers.hasStereotype">
1512                                    </test>
1513                                 </or>
1514                              </and>
1515                           </adapt>
1516                        </iterate>
1517                     </with>
1518                  </and>
1519               </with>
1520            </visibleWhen>
1521         </menu>
1522      </menuContribution>
1523   </extension>
1524    <!-- 
1525    <extension
1526         point="org.eclipse.papyrus.views.modelexplorer.actionHandler">
1527
1528      <customAction
1529            actionHandler="org.eclipse.papyrus.views.modelexplorer.factory.DefaultEMFActionsFactory"
1530            actionId="org.eclipse.papyrus.views.modelexplorer.factory.defaultEMFActions"
1531            afterAction="org.eclipse.papyrus.views.modelexplorer.factory.renameAction"
1532            needSeparator="true">
1533      </customAction>
1534   </extension>
1535-->
1536<extension point="org.eclipse.ui.menus">
1537
1538    <!-- ModelExplorer toolbar -->
1539    <menuContribution allPopups="false" locationURI="toolbar:org.openmodelica.modelicaml.modelexplorer">
1540
1541        <!-- Load modisco browser customization command -->     
1542        <command commandId="org.eclipse.papyrus.views.modelexplorer.LoadBrowserCustomization" icon="icons/etool16/uiCustom.gif" label="Load browser customization" style="push">
1543        </command>
1544
1545        <!-- Search element command --> 
1546        <command commandId="org.eclipse.papyrus.views.modelexplorer.searchelement" icon="icons/etool16/search.gif" label="Search element" style="push">
1547        </command>
1548       
1549        <!-- Sort elements command --> 
1550        <command commandId="org.eclipse.papyrus.views.modelexplorer.sortelement" icon="icons/etool16/sort.gif" label="sort" style="toggle">
1551        </command>
1552    </menuContribution>
1553 <menuContribution allPopups="false" locationURI="popup:org.openmodelica.modelicaml.modelexplorer.popup">
1554    <separator name="popup:org.eclipse.papyrus.views.modelexplorer.modelexplorer.popup.separator0" visible="true">
1555    </separator>
1556    <command commandId="org.eclipse.ui.edit.rename" icon="icons/etool16/rename.gif" id="org.eclipse.papyrus.views.modelexplorer.modelexplorer.popup.rename" label="&amp;Rename" style="push" tooltip="Rename the element">
1557       <visibleWhen checkEnabled="true">
1558       </visibleWhen>
1559    </command>
1560    <separator name="popup:org.eclipse.papyrus.views.modelexplorer.modelexplorer.popup.separator1" visible="true">
1561    </separator>
1562    <command commandId="org.eclipse.ui.edit.undo" id="org.eclipse.papyrus.views.modelexplorer.modelexplorer.popup.undo" label="&amp;Undo" style="push">
1563    </command>
1564    <command commandId="org.eclipse.ui.edit.redo" id="org.eclipse.papyrus.views.modelexplorer.modelexplorer.popup.redo" label="&amp;Redo" style="push">
1565    </command>
1566    <separator name="popup:org.eclipse.papyrus.views.modelexplorer.modelexplorer.popup.separator2" visible="true">
1567    </separator>
1568    <command commandId="org.eclipse.papyrus.views.modelexplorer.popup.open.command" icon="icons/etool16/forward.gif" id="org.eclipse.papyrus.views.modelexplorer.modelexplorer.popup.open" label="&amp;Open" style="push" tooltip="Open">
1569       <visibleWhen checkEnabled="true">
1570       </visibleWhen>
1571    </command>
1572    <command commandId="org.eclipse.papyrus.views.modelexplorer.popup.open.new.command" icon="icons/etool16/arrow_double.gif" id="org.eclipse.papyrus.views.modelexplorer.modelexplorer.popup.open.new" label="Open In &amp;New Table" style="push" tooltip="Open in new tab">
1573       <visibleWhen checkEnabled="true">
1574       </visibleWhen>
1575    </command>
1576    <command commandId="org.eclipse.papyrus.views.modelexplorer.popup.close.command" icon="icons/etool16/close.png" id="org.eclipse.papyrus.views.modelexplorer.modelexplorer.popup.close" label="&amp;Close" style="push" tooltip="Close">
1577       <visibleWhen checkEnabled="true">
1578       </visibleWhen>
1579    </command>
1580    <command commandId="org.eclipse.papyrus.views.modelexplorer.close.all.command" icon="icons/etool16/closeAll.png" id="org.eclipse.papyrus.views.modelexplorer.modelexplorer.popup.close.all" label="Close &amp;All" style="push" tooltip="Close All">
1581       <visibleWhen checkEnabled="true">
1582       </visibleWhen>
1583    </command>
1584    <command commandId="org.eclipse.papyrus.views.modelexplorer.duplicate.command" icon="icons/etool16/duplicate.png" id="org.eclipse.papyrus.views.modelexplorer.modelexplorer.popup.duplicate" label="&amp;Duplicate" style="push" tooltip="Duplicate the element">
1585       <visibleWhen checkEnabled="true">
1586       </visibleWhen>
1587    </command>
1588    <separator name="popup:org.eclipse.papyrus.views.modelexplorer.modelexplorer.popup.separator3" visible="true">
1589    </separator>
1590    <command commandId="org.eclipse.ui.edit.cut" id="org.eclipse.papyrus.views.modelexplorer.modelexplorer.popup.cut" label="Cu&amp;t" style="push">
1591       <visibleWhen checkEnabled="false">
1592          <with variable="selection">
1593                <!-- We add this test in order to refresh the Cut action in the menu edit -->
1594             <test forcePluginActivation="true" property="org.eclipse.papyrus.views.modelexplorer.tester.isEObject" value="true">
1595             </test>
1596          </with>
1597       </visibleWhen>
1598    </command>
1599    <command commandId="org.eclipse.ui.edit.copy" id="org.eclipse.papyrus.views.modelexplorer.modelexplorer.popup.copy" label="&amp;Copy" style="push">
1600       <visibleWhen checkEnabled="false">
1601          <with variable="selection">
1602                <!-- We add this test in order to refresh the Copy action in the menu edit -->
1603             <test forcePluginActivation="true" property="org.eclipse.papyrus.views.modelexplorer.tester.isEObject" value="true">
1604             </test>
1605          </with>
1606       </visibleWhen>
1607    </command>
1608    <command commandId="org.eclipse.ui.edit.paste" id="org.eclipse.papyrus.views.modelexplorer.modelexplorer.popup.paste" label="&amp;Paste" style="push">
1609       <visibleWhen checkEnabled="false">
1610          <with variable="selection">
1611                <!-- We add this test in order to refresh the Paste action in the menu edit -->
1612             <test forcePluginActivation="true" property="org.eclipse.papyrus.views.modelexplorer.tester.isEObject" value="true">
1613             </test>
1614          </with>
1615       </visibleWhen>
1616    </command>
1617    <separator
1618          name="popup:org.eclipse.papyrus.views.modelexplorer.modelexplorer.popup.separator3"
1619          visible="true">
1620    </separator>
1621    <command commandId="org.eclipse.ui.edit.delete" disabledIcon="IMG_TOOL_DELETE_DISABLED" icon="IMG_TOOL_DELETE" label="Delete" style="push" tooltip="Delete">
1622       <visibleWhen checkEnabled="true">
1623          <and>
1624             <with variable="selection">
1625                <iterate>
1626                   <adapt type="org.eclipse.emf.ecore.EObject">
1627                   </adapt>
1628                </iterate>
1629             </with>
1630          </and>
1631       </visibleWhen>
1632    </command>
1633 </menuContribution>
1634    <!-- ModelExplorer Contextual menu -->       
1635       
1636</extension>
1637
1638<!-- Command declarations (for model explorer toolbar and contextual menu -->
1639<extension point="org.eclipse.ui.commands">
1640
1641    <!-- Command declaration : Load modisco browser customization command -->           
1642    <command categoryId="org.eclipse.papyrus.editor.category" defaultHandler="org.openmodelica.modelicaml.modelexplorer.handler.LoadBrowserCustomization" description="Load a customization for the papyrus browser" id="org.eclipse.papyrus.views.modelexplorer.LoadBrowserCustomization" name="loadBrowserCustomization">
1643    </command>
1644   
1645    <!-- Command declaration : Search element command -->           
1646    <command categoryId="org.eclipse.papyrus.editor.category" defaultHandler="org.eclipse.papyrus.views.modelexplorer.handler.SearchElementHandler" description="Search an element in the model explorer" id="org.eclipse.papyrus.views.modelexplorer.searchelement" name="searchelement">
1647    </command>
1648   
1649    <!-- Command declaration : Sort elements command -->           
1650    <command categoryId="org.eclipse.papyrus.editor.category" defaultHandler="org.eclipse.papyrus.views.modelexplorer.handler.SortElementHandler" description="Sort elements" id="org.eclipse.papyrus.views.modelexplorer.sortelement" name="SortElement">
1651    </command>
1652       
1653    <!-- Command declaration : Delete element command -->
1654    <command categoryId="org.eclipse.papyrus.editor.category" defaultHandler="org.eclipse.papyrus.views.modelexplorer.handler.DeleteCommandHandler" description="Delete" id="org.eclipse.papyrus.uml.service.creation.DeleteCommand" name="Delete">
1655    </command>       
1656</extension>
1657   
1658   
1659   <extension point="org.eclipse.core.runtime.preferences">
1660        <?gmfgen generated="false"?>
1661        <initializer class="org.eclipse.papyrus.views.modelexplorer.preferences.NavigatorPreferenceInitializer"/>
1662   </extension>
1663
1664<!-- This declaration is added in order command (DeleteCommandHandler) status to be
1665     verified (isVisible and isEnabled) before any attempt to execute the command,
1666     and to mask the command in case it is not supported or executable.
1667  -->
1668<extension point="org.eclipse.ui.startup">
1669    <startup class="org.eclipse.papyrus.views.modelexplorer.Activator"/>
1670</extension>
1671<extension point="org.eclipse.ui.navigator.linkHelper">
1672   <linkHelper class="org.eclipse.papyrus.views.modelexplorer.LinkHelper" id="org.eclipse.papyrus.views.modelexplorer.linkHelper">
1673       <selectionEnablement>
1674         <instanceof value="java.lang.Object">
1675         </instanceof>
1676      </selectionEnablement>
1677      <editorInputEnablement>
1678         <instanceof value="org.eclipse.ui.part.IFileEditorInput">
1679         </instanceof>
1680      </editorInputEnablement>
1681   </linkHelper>
1682</extension>
1683
1684<!-- This service listen the selection, ensures that the modelExplorer is active, and update the 
1685     deleteInModelExplorer variable according to the selection.
1686  -->
1687<!--
1688<extension point="org.eclipse.ui.services">
1689    <sourceProvider provider="org.eclipse.papyrus.views.modelexplorer.provider.ActionStateSourceProvider">
1690        <variable name="deleteInModelExplorer" priorityLevel="workbench"/>
1691    </sourceProvider>
1692</extension>
1693  -->
1694<!-- This handler is activated when deleteInModelExplorer variable is valid.
1695  -->
1696 <!--
1697<extension point="org.eclipse.ui.handlers">
1698    <handler class="org.eclipse.papyrus.views.modelexplorer.handler.DeleteCommandHandler" commandId="org.eclipse.ui.edit.delete">
1699        <activeWhen>
1700        <with variable="deleteInModelExplorer">
1701            <equals value="enabled"/>
1702        </with>
1703        </activeWhen>
1704    </handler>
1705</extension>
1706-->
1707<extension point="org.eclipse.ui.commands">
1708   <command categoryId="org.eclipse.papyrus.editor.category" description="The command to open in a tab" id="org.eclipse.papyrus.views.modelexplorer.popup.open.command" name="Open Command">
1709   </command>
1710   <command categoryId="org.eclipse.papyrus.editor.category" description="The command to open in a new tab" id="org.eclipse.papyrus.views.modelexplorer.popup.open.new.command" name="Open In New Tab Command">
1711   </command>
1712   <command categoryId="org.eclipse.papyrus.editor.category" description="The command to close" id="org.eclipse.papyrus.views.modelexplorer.popup.close.command" name="Close Command">
1713   </command>
1714   <command categoryId="org.eclipse.papyrus.editor.category" description="The command to close all " id="org.eclipse.papyrus.views.modelexplorer.close.all.command" name="Close All Command">
1715   </command>
1716   <command categoryId="org.eclipse.papyrus.editor.category" description="The Command to duplicate the selected element" id="org.eclipse.papyrus.views.modelexplorer.duplicate.command" name="Duplicate ">
1717   </command>
1718</extension>
1719<extension point="org.eclipse.ui.handlers">
1720   <handler commandId="org.eclipse.papyrus.views.modelexplorer.popup.close.command">
1721      <activeWhen>
1722         <with variable="selection">
1723            <and>
1724               <test forcePluginActivation="true" property="org.eclipse.papyrus.views.modelexplorer.tester.isPage" value="true">
1725               </test>
1726            </and>
1727         </with>
1728      </activeWhen>
1729      <class class="org.eclipse.papyrus.views.modelexplorer.handler.CloseHandler">
1730         <parameter name="close_parameter" value="selection">
1731         </parameter>
1732      </class>
1733   </handler>
1734   <handler commandId="org.eclipse.papyrus.views.modelexplorer.close.all.command">
1735      <class class="org.eclipse.papyrus.views.modelexplorer.handler.CloseHandler">
1736         <parameter name="close_parameter" value="all">
1737         </parameter>
1738      </class>
1739      <activeWhen>
1740         <with variable="selection">
1741            <and>
1742               <test forcePluginActivation="true" property="org.eclipse.papyrus.views.modelexplorer.tester.isPage" value="true">
1743               </test>
1744            </and>
1745         </with>
1746      </activeWhen>
1747   </handler>
1748   <handler commandId="org.eclipse.papyrus.views.modelexplorer.popup.open.command">
1749      <activeWhen>
1750         <with variable="selection">
1751            <and>
1752               <test forcePluginActivation="true" property="org.eclipse.papyrus.views.modelexplorer.tester.isPage" value="true">
1753               </test>
1754            </and>
1755         </with>
1756      </activeWhen>
1757      <class class="org.eclipse.papyrus.views.modelexplorer.handler.OpenHandler">
1758         <parameter name="open_parameter" value="close">
1759         </parameter>
1760      </class>
1761   </handler>
1762   <handler commandId="org.eclipse.papyrus.views.modelexplorer.popup.open.new.command">
1763      <activeWhen>
1764         <with variable="selection">
1765            <and>
1766               <test forcePluginActivation="true" property="org.eclipse.papyrus.views.modelexplorer.tester.isPage" value="true">
1767               </test>
1768            </and>
1769         </with>
1770      </activeWhen>
1771      <class class="org.eclipse.papyrus.views.modelexplorer.handler.OpenHandler">
1772         <parameter name="open_parameter" value="already_open">
1773         </parameter>
1774      </class>
1775   </handler>
1776   <handler class="org.eclipse.papyrus.views.modelexplorer.handler.CutHandler" commandId="org.eclipse.ui.edit.cut">
1777      <activeWhen>
1778         <and>
1779            <with variable="activePart">
1780               <instanceof value="org.eclipse.papyrus.views.modelexplorer.ModelExplorerPageBookView">
1781               </instanceof>
1782            </with>
1783            <with variable="selection">
1784                  <!-- We add this test in order to refresh the Cut action in the menu edit -->
1785               <test forcePluginActivation="true" property="org.eclipse.papyrus.views.modelexplorer.tester.isEObject" value="true">
1786               </test>
1787            </with>
1788         </and>
1789      </activeWhen>
1790   </handler>
1791   <handler class="org.eclipse.papyrus.views.modelexplorer.handler.UndoHandler" commandId="org.eclipse.ui.edit.undo">
1792      <activeWhen>
1793         <and>
1794            <with variable="activePart">
1795               <instanceof value="org.eclipse.papyrus.views.modelexplorer.ModelExplorerPageBookView">
1796               </instanceof>
1797            </with>
1798            <with variable="activePart">
1799                  <!-- We add this test in order to refresh the Undo action in the menu file -->
1800               <test forcePluginActivation="true" property="org.eclipse.papyrus.views.modelexplorer.tester.view.isModelExplorer" value="true">
1801               </test>
1802            </with>
1803         </and>
1804      </activeWhen>
1805   </handler>
1806   <handler class="org.eclipse.papyrus.views.modelexplorer.handler.RedoHandler" commandId="org.eclipse.ui.edit.redo">
1807      <activeWhen>
1808         <and>
1809            <with variable="activePart">
1810               <instanceof value="org.eclipse.papyrus.views.modelexplorer.ModelExplorerPageBookView">
1811               </instanceof>
1812            </with>
1813            <with variable="activePart">
1814                  <!-- We add this test in order to refresh the Redo action in the menu edit -->
1815               <test forcePluginActivation="true" property="org.eclipse.papyrus.views.modelexplorer.tester.view.isModelExplorer" value="true">
1816               </test>
1817            </with>
1818         </and>
1819      </activeWhen>
1820   </handler>
1821</extension>
1822<extension point="org.eclipse.core.expressions.propertyTesters">
1823      <!-- the property tester is used to enabled/disabled handler -->
1824   <propertyTester class="org.eclipse.papyrus.views.modelexplorer.provider.PropertyTester" id="org.eclipse.papyrus.views.modelexplorer.tester" namespace="org.eclipse.papyrus.views.modelexplorer.tester" properties="isEObject, isPage" type="org.eclipse.jface.viewers.IStructuredSelection">
1825   </propertyTester>
1826   <propertyTester class="org.eclipse.papyrus.views.modelexplorer.provider.PropertyTester" id="org.eclipse.papyrus.views.modelexplorer.tester.view" namespace="org.eclipse.papyrus.views.modelexplorer.tester.view" properties="isModelExplorer" type="org.eclipse.ui.IWorkbenchPart">
1827   </propertyTester>
1828</extension>
1829<!--<extension
1830      point="org.eclipse.emf.facet.infra.query.registration">
1831   <modelqueryset
1832         file="resources/PapyrusEcoreBrowserQuery.querySet">
1833   </modelqueryset>
1834</extension>
1835
1836   <extension point="org.eclipse.emf.facet.infra.browser.custom.core.registration">
1837      <browserCustomization file="resources/PapyrusEcoreBrowser.uiCustom"/>
1838   </extension>
1839   
1840   <extension point="org.eclipse.emf.facet.infra.facet.registration">
1841      <facetset file="resources/PapyrusUMLFacet.facetSet">
1842      </facetset>
1843   </extension>
1844   <extension point="org.eclipse.emf.facet.infra.browser.custom.core.registration">
1845      <browserCustomization
1846            file="resources/UMLFacetDefaultBrowserCustomization.uiCustom"
1847            loadByDefault="true"/>
1848      <browserCustomization
1849            file="resources/UMLPapyrusDefaultBrowserCustomization.uiCustom"
1850            loadByDefault="true">
1851      </browserCustomization>
1852      <browserCustomization
1853            file="resources/NotationCustomization.uiCustom"
1854            loadByDefault="true">
1855      </browserCustomization>
1856   </extension>
1857-->
1858</plugin>
Note: See TracBrowser for help on using the repository browser.