|
Re: Is there a specific extension point for diagram context menu? [message #1266507 is a reply to message #1266146] |
Fri, 07 March 2014 14:53 |
|
Le 07/03/2014 03:50, Michael Lukaszczyk a écrit :
> Hey there,
Hi,
> is it possible to extend the diagram with an additional context menu
> entry? I mean by right clicking on the canvas (not on a specific
> element). Like the org.eclipse.ui.popupMenus extension point for the
> file browser. Is there a specific sirius extension point or is it gmf
> specific?
It should be possible to extends the diagram contextual menu with
org.eclipse.ui.popupMenus or org.eclipse.ui.menus
This is done by the org.eclipse.sirius.diagram plugin itself for several
menus: Show/Hide (menu), Delete from Diagram (action provided with an
object contribution), Refresh (command provided with a menu contribution).
These menu are created with a locationURI=
popup:org.eclipse.ui.popup.any?after=XXX , with XXX is one of the
contextual menu group, and ?after=XXX is optional, the additional menu
should be added to the addition group if there is no specified placement.
You should when possible add a visibleWhen element to avoid to provide
your menu for all existing contextual menu. For example, if you want to
add the menu for the diagram edit part only (the canvas):
<visibleWhen checkEnabled="false">
<with variable="selection"> <!-- or activeMenuSelection -->
<iterate>
<instanceof
value="org.eclipse.sirius.diagram.edit.api.part.IDDiagramEditPart">
</instanceof>
</iterate>
</with>
</visibleWhen>
>
> Thanks,
>
> Michael
Regards
Maxime
Maxime Porhel - Obeo
Need training or professional services for Sirius?
http://www.obeodesigner.com/sirius
|
|
|
Powered by
FUDForum. Page generated in 0.03624 seconds