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

<plugin>
   <extension-point id="actionHandler" name="actionHandler" schema="schema/org.eclipse.papyrus.views.modelexplorer.actionHandler.exsd"/>
   <extension point="org.eclipse.ui.views">
      <view category="org.eclipse.papyrus.views.category" class="org.eclipse.papyrus.views.modelexplorer.ModelExplorerPageBookView" icon="icons/ModelExplorer.gif" id="org.eclipse.papyrus.views.modelexplorer.modelexplorer" name="Model Explorer" restorable="true">
      </view>
   </extension>
   <extension point="org.eclipse.ui.navigator.viewer">
      <viewer popupMenuId="org.eclipse.papyrus.views.modelexplorer.modelexplorer.popup" viewerId="org.eclipse.papyrus.views.modelexplorer.modelexplorer">
      </viewer>
      <viewerContentBinding viewerId="org.eclipse.papyrus.views.modelexplorer.modelexplorer">
         <includes>
            <contentExtension pattern="org.eclipse.papyrus.views.modelexplorer.*">
            </contentExtension>
         </includes>
      </viewerContentBinding>
      <!--We add a drag assistant in order support drag and drop between Model Explorer and Table Editor or other View/editors -->
      <dragAssistant class="org.eclipse.papyrus.views.modelexplorer.dnd.EObjectDragAdapterAssistant" viewerId="org.eclipse.papyrus.views.modelexplorer.modelexplorer">
      </dragAssistant>
   </extension>
   <extension point="org.eclipse.ui.navigator.navigatorContent">
      <navigatorContent activeByDefault="false" contentProvider="org.eclipse.papyrus.infra.emf.providers.MoDiscoContentProvider" id="org.eclipse.papyrus.views.modelexplorer.navigatorContent" labelProvider="org.eclipse.papyrus.views.modelexplorer.MoDiscoLabelProvider" name="Model Contents" priority="lowest">
         <triggerPoints>
            <or>
               <instanceof value="org.eclipse.emf.ecore.EObject">
               </instanceof>
               <adapt type="org.eclipse.emf.ecore.EObject">
               </adapt>
               <instanceof value="java.lang.Object">
               </instanceof>
            </or>
         </triggerPoints>
         <possibleChildren>
            <or>
               <instanceof value="org.eclipse.gmf.runtime.notation.impl.DiagramImpl">
               </instanceof>
               <instanceof value="org.eclipse.emf.facet.infra.browser.uicore.internal.model.ModelElementItem"/>
            </or>
         </possibleChildren>
         <actionProvider class="org.eclipse.papyrus.views.modelexplorer.actionprovider.GenericTransformActionProvider" id="org.eclipse.papyrus.views.modelexplorer.actionprovider.GenericTransformActionProvider">
            <enablement>
               <or>
                  <adapt type="org.eclipse.emf.ecore.EObject">
                  </adapt>
               </or>
            </enablement>
         </actionProvider>
          
         <actionProvider class="org.eclipse.papyrus.views.modelexplorer.actionprovider.EditingDomainActionProvider" id="org.eclipse.papyrus.views.modelexplorer.actionprovider.EditingDomainActionProvider">
                  <enablement>
               <and>
                  <not>
                     <instanceof value="org.eclipse.gmf.runtime.notation.Diagram">
                     </instanceof>
                  </not>
                  <adapt type="org.eclipse.emf.ecore.EObject">
                  </adapt>
               </and>
            </enablement>
         </actionProvider>
         <dropAssistant class="org.eclipse.papyrus.views.modelexplorer.dnd.CommonDropAdapterAssistant" id="org.eclipse.papyrus.views.modelexplorer.dnd.CommonDropAdapterAssistant">
            <possibleDropTargets>
               <or>
                  <instanceof value="org.eclipse.gmf.runtime.notation.impl.DiagramImpl">
                  </instanceof>
                  <adapt type="org.eclipse.emf.ecore.EObject">
                  </adapt>
               </or>
            </possibleDropTargets>
         </dropAssistant>
    
      </navigatorContent>
   </extension>
    <!--  
    <extension
         point="org.eclipse.papyrus.views.modelexplorer.actionHandler">

      <customAction
            actionHandler="org.eclipse.papyrus.views.modelexplorer.factory.DefaultEMFActionsFactory"
            actionId="org.eclipse.papyrus.views.modelexplorer.factory.defaultEMFActions"
            afterAction="org.eclipse.papyrus.views.modelexplorer.factory.renameAction"
            needSeparator="true">
      </customAction>
   </extension>
-->
<extension point="org.eclipse.ui.menus">

	<!-- ModelExplorer toolbar -->
	<menuContribution allPopups="false" locationURI="toolbar:org.eclipse.papyrus.views.modelexplorer.modelexplorer">

		<!-- Load modisco browser customization command -->		
		<command commandId="org.eclipse.papyrus.views.modelexplorer.LoadBrowserCustomization" icon="icons/etool16/uiCustom.gif" label="Load browser customization" style="push">
		</command>

		<!-- Search element command -->	
		<command commandId="org.eclipse.papyrus.views.modelexplorer.searchelement" icon="icons/etool16/search.gif" label="Search element" style="push">
		</command>
		
		<!-- Sort elements command -->	
		<command commandId="org.eclipse.papyrus.views.modelexplorer.sortelement" icon="icons/etool16/sort.gif" label="sort" style="toggle">
		</command>
	</menuContribution>
 <menuContribution allPopups="false" locationURI="popup:org.eclipse.papyrus.views.modelexplorer.modelexplorer.popup">
    <menu id="org.eclipse.papyrus.views.modelexplorer.popupmenu.createchild" label="New Child">
    </menu>
    <menu id="org.eclipse.papyrus.views.modelexplorer.popupmenu.creatediagram" label="New Diagram">
    </menu>
    <command commandId="org.eclipse.ui.edit.delete" disabledIcon="IMG_TOOL_DELETE_DISABLED" icon="IMG_TOOL_DELETE" label="Delete" style="push" tooltip="Delete">
       <visibleWhen checkEnabled="true">
          <and>
             <with variable="selection">
                <iterate>
                   <adapt type="org.eclipse.emf.ecore.EObject">
                   </adapt>
                </iterate>
             </with>
          </and>
       </visibleWhen>
    </command>
    <separator name="popup:org.eclipse.papyrus.views.modelexplorer.modelexplorer.popup.separator0" visible="true">
    </separator>
    <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">
       <visibleWhen checkEnabled="true">
       </visibleWhen>
    </command>
    <separator name="popup:org.eclipse.papyrus.views.modelexplorer.modelexplorer.popup.separator1" visible="true">
    </separator>
    <command commandId="org.eclipse.ui.edit.undo" id="org.eclipse.papyrus.views.modelexplorer.modelexplorer.popup.undo" label="&amp;Undo" style="push">
    </command>
    <command commandId="org.eclipse.ui.edit.redo" id="org.eclipse.papyrus.views.modelexplorer.modelexplorer.popup.redo" label="&amp;Redo" style="push">
    </command>
    <separator name="popup:org.eclipse.papyrus.views.modelexplorer.modelexplorer.popup.separator2" visible="true">
    </separator>
    <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">
       <visibleWhen checkEnabled="true">
       </visibleWhen>
    </command>
    <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">
       <visibleWhen checkEnabled="true">
       </visibleWhen>
    </command>
    <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">
       <visibleWhen checkEnabled="true">
       </visibleWhen>
    </command>
    <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">
       <visibleWhen checkEnabled="true">
       </visibleWhen>
    </command>
    <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">
       <visibleWhen checkEnabled="true">
       </visibleWhen>
    </command>
    <separator name="popup:org.eclipse.papyrus.views.modelexplorer.modelexplorer.popup.separator3" visible="true">
    </separator>
    <command commandId="org.eclipse.ui.edit.cut" id="org.eclipse.papyrus.views.modelexplorer.modelexplorer.popup.cut" label="Cu&amp;t" style="push">
       <visibleWhen checkEnabled="false">
          <with variable="selection">
                <!-- We add this test in order to refresh the Cut action in the menu edit -->
             <test forcePluginActivation="true" property="org.eclipse.papyrus.views.modelexplorer.tester.isEObject" value="true">
             </test>
          </with>
       </visibleWhen>
    </command>
    <command commandId="org.eclipse.ui.edit.copy" id="org.eclipse.papyrus.views.modelexplorer.modelexplorer.popup.copy" label="&amp;Copy" style="push">
       <visibleWhen checkEnabled="false">
          <with variable="selection">
                <!-- We add this test in order to refresh the Copy action in the menu edit -->
             <test forcePluginActivation="true" property="org.eclipse.papyrus.views.modelexplorer.tester.isEObject" value="true">
             </test>
          </with>
       </visibleWhen>
    </command>
    <command commandId="org.eclipse.ui.edit.paste" id="org.eclipse.papyrus.views.modelexplorer.modelexplorer.popup.paste" label="&amp;Paste" style="push">
       <visibleWhen checkEnabled="false">
          <with variable="selection">
                <!-- We add this test in order to refresh the Paste action in the menu edit -->
             <test forcePluginActivation="true" property="org.eclipse.papyrus.views.modelexplorer.tester.isEObject" value="true">
             </test>
          </with>
       </visibleWhen>
    </command>
 </menuContribution>
	<!-- ModelExplorer Contextual menu -->       
       
</extension>

<!-- Command declarations (for model explorer toolbar and contextual menu -->
<extension point="org.eclipse.ui.commands">

	<!-- Command declaration : Load modisco browser customization command -->			
	<command categoryId="org.eclipse.papyrus.editor.category" defaultHandler="org.eclipse.papyrus.views.modelexplorer.handler.LoadBrowserCustomization" description="Load a customization for the papyrus browser" id="org.eclipse.papyrus.views.modelexplorer.LoadBrowserCustomization" name="loadBrowserCustomization">
	</command>
	
	<!-- Command declaration : Search element command -->			
	<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">
	</command>
	
	<!-- Command declaration : Sort elements command -->			
	<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">
	</command>
       
	<!-- Command declaration : Delete element command -->
	<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">
	</command>       
</extension>
    
    
   <extension point="org.eclipse.core.runtime.preferences">
		<?gmfgen generated="false"?>
		<initializer class="org.eclipse.papyrus.views.modelexplorer.preferences.NavigatorPreferenceInitializer"/>
   </extension>
   <extension point="org.eclipse.ui.preferencePages">
      <page category="org.eclipse.papyrus.infra.core.sasheditor.preferences.generalcategory" class="org.eclipse.papyrus.views.modelexplorer.preferences.NavigatorPreferencePage" id="org.eclipse.papyrus.views.modelexplorer.preferences.NavigatorPreferencePage" name="Papyrus Model Explorer">
      </page>
   </extension>

<!-- This declaration is added in order command (DeleteCommandHandler) status to be
     verified (isVisible and isEnabled) before any attempt to execute the command, 
     and to mask the command in case it is not supported or executable.
  -->
<extension point="org.eclipse.ui.startup">
	<startup class="org.eclipse.papyrus.views.modelexplorer.Activator"/>
</extension>
<extension point="org.eclipse.ui.navigator.linkHelper">
   <linkHelper class="org.eclipse.papyrus.views.modelexplorer.LinkHelper" id="org.eclipse.papyrus.views.modelexplorer.linkHelper">
       <selectionEnablement>
         <instanceof value="java.lang.Object">
         </instanceof>
      </selectionEnablement>
      <editorInputEnablement>
         <instanceof value="org.eclipse.ui.part.IFileEditorInput">
         </instanceof>
      </editorInputEnablement>
   </linkHelper>
</extension>

<!-- This handler is activated when deleteInModelExplorer variable is valid.
  -->
<extension point="org.eclipse.ui.handlers">
	<handler class="org.eclipse.papyrus.views.modelexplorer.handler.DeleteCommandHandler" commandId="org.eclipse.ui.edit.delete">
		<activeWhen>
     <with
           variable="selection">
        <and>
           <test
                 forcePluginActivation="true"
                 property="org.eclipse.papyrus.views.modelexplorer.tester.isPage"
                 value="false">
           </test>
           <test
                 forcePluginActivation="true"
                 property="org.eclipse.papyrus.views.modelexplorer.tester.isEObject"
                 value="true">
           </test>
        </and>
     </with>
		</activeWhen>
	</handler>
</extension>
<extension point="org.eclipse.ui.commands">
   <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">
   </command>
   <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">
   </command>
   <command categoryId="org.eclipse.papyrus.editor.category" description="The command to close" id="org.eclipse.papyrus.views.modelexplorer.popup.close.command" name="Close Command">
   </command>
   <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">
   </command>
   <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 ">
   </command>
</extension>
<extension point="org.eclipse.ui.handlers">
   <handler commandId="org.eclipse.papyrus.views.modelexplorer.popup.close.command">
      <activeWhen>
         <with variable="selection">
            <and>
               <test forcePluginActivation="true" property="org.eclipse.papyrus.views.modelexplorer.tester.isPage" value="true">
               </test>
            </and>
         </with>
      </activeWhen>
      <class class="org.eclipse.papyrus.views.modelexplorer.handler.CloseHandler">
         <parameter name="close_parameter" value="selection">
         </parameter>
      </class>
   </handler>
   <handler commandId="org.eclipse.papyrus.views.modelexplorer.close.all.command">
      <class class="org.eclipse.papyrus.views.modelexplorer.handler.CloseHandler">
         <parameter name="close_parameter" value="all">
         </parameter>
      </class>
      <activeWhen>
         <with variable="selection">
            <and>
               <test forcePluginActivation="true" property="org.eclipse.papyrus.views.modelexplorer.tester.isPage" value="true">
               </test>
            </and>
         </with>
      </activeWhen>
   </handler>
   <handler commandId="org.eclipse.papyrus.views.modelexplorer.popup.open.command">
      <activeWhen>
         <with variable="selection">
            <and>
               <test forcePluginActivation="true" property="org.eclipse.papyrus.views.modelexplorer.tester.isPage" value="true">
               </test>
            </and>
         </with>
      </activeWhen>
      <class class="org.eclipse.papyrus.views.modelexplorer.handler.OpenHandler">
         <parameter name="open_parameter" value="close">
         </parameter>
      </class>
   </handler>
   <handler commandId="org.eclipse.papyrus.views.modelexplorer.popup.open.new.command">
      <activeWhen>
         <with variable="selection">
            <and>
               <test forcePluginActivation="true" property="org.eclipse.papyrus.views.modelexplorer.tester.isPage" value="true">
               </test>
            </and>
         </with>
      </activeWhen>
      <class class="org.eclipse.papyrus.views.modelexplorer.handler.OpenHandler">
         <parameter name="open_parameter" value="already_open">
         </parameter>
      </class>
   </handler>
   <handler class="org.eclipse.papyrus.views.modelexplorer.handler.CutHandler" commandId="org.eclipse.ui.edit.cut">
      <activeWhen>
         <and>
            <with variable="activePart">
               <instanceof value="org.eclipse.papyrus.views.modelexplorer.ModelExplorerPageBookView">
               </instanceof>
            </with>
            <with variable="selection">
                  <!-- We add this test in order to refresh the Cut action in the menu edit -->
               <test forcePluginActivation="true" property="org.eclipse.papyrus.views.modelexplorer.tester.isEObject" value="true">
               </test>
            </with>
         </and>
      </activeWhen>
   </handler>
   <handler class="org.eclipse.papyrus.views.modelexplorer.handler.UndoHandler" commandId="org.eclipse.ui.edit.undo">
      <activeWhen>
         <and>
            <with variable="activePart">
               <instanceof value="org.eclipse.papyrus.views.modelexplorer.ModelExplorerPageBookView">
               </instanceof>
            </with>
            <with variable="activePart">
                  <!-- We add this test in order to refresh the Undo action in the menu file -->
               <test forcePluginActivation="true" property="org.eclipse.papyrus.views.modelexplorer.tester.view.isModelExplorer" value="true">
               </test>
            </with>
         </and>
      </activeWhen>
   </handler>
   <handler class="org.eclipse.papyrus.views.modelexplorer.handler.RedoHandler" commandId="org.eclipse.ui.edit.redo">
      <activeWhen>
         <and>
            <with variable="activePart">
               <instanceof value="org.eclipse.papyrus.views.modelexplorer.ModelExplorerPageBookView">
               </instanceof>
            </with>
            <with variable="activePart">
                  <!-- We add this test in order to refresh the Redo action in the menu edit -->
               <test forcePluginActivation="true" property="org.eclipse.papyrus.views.modelexplorer.tester.view.isModelExplorer" value="true">
               </test>
            </with>
         </and>
      </activeWhen>
   </handler>
</extension>
<extension point="org.eclipse.core.expressions.propertyTesters">
      <!-- the property tester is used to enabled/disabled handler -->
   <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">
   </propertyTester>
   <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">
   </propertyTester>
</extension>

   <extension point="org.eclipse.emf.facet.infra.query.registration">
      <modelqueryset file="resources/PapyrusEcoreBrowserQuery.querySet"/>
   </extension>
   <extension point="org.eclipse.emf.facet.infra.browser.custom.core.registration">
      <browserCustomization file="resources/PapyrusEcoreBrowser.uiCustom"/>
   </extension>
   <extension
         point="org.eclipse.papyrus.infra.services.labelprovider.labelProvider">
      <context
            description="The ModelExplorer labelProvider context"
            id="org.eclipse.papyrus.views.modelexplorer.labelProvider.context">
      </context>
   </extension>
</plugin>

Back to the top