|
Re: Add item in context menu [message #12709 is a reply to message #12668] |
Fri, 05 June 2009 09:04 |
Eclipse User |
|
|
|
Originally posted by: atoulme.intalio.com
mio wrote:
> hi
> a question: it's possible to add an item in the context menu when there
> is a right click over a pool ?
> what is the best way (if it's possible) ?
> best regards
>
Sure, it's part of the GMF standard extensions.
You will need to plug your own
org.eclipse.gmf.runtime.common.ui.services.action.contributi onItemProviders
extension point and provide a new popupContribution, like this one:
<popupContribution
class=" org.eclipse.gmf.runtime.diagram.ui.providers.DiagramContextM enuProvider ">
<popupStructuredContributionCriteria
objectClass=" org.eclipse.stp.bpmn.diagram.edit.parts.SequenceEdgeEditPart "
objectCount="1">
</popupStructuredContributionCriteria>
<popupMenu
id="conditionType"
path="/additionsGroup">
</popupMenu>
<popupMenuGroup
id="group1"
path="/conditionType/"
separator="true">
</popupMenuGroup>
<popupAction
id="conditionTypeNone"
path="/conditionType/group1">
</popupAction>
</popupContribution>
You will need to implement your own action provider, extending
AbstractContributionItemProvider and bind to the extension point as well.
I am sure the GMF developers have that documented somewhere in a more
complete way.
Thanks,
Antoine
|
|
|
Powered by
FUDForum. Page generated in 0.02525 seconds