|How to disable all popup menu items? [message #1384954]
||Tue, 03 June 2014 09:34
| Bartosz Popiela
Registered: March 2012
1. I have some.domain.SomeDiagramEditor editor extending org.eclipse.gmf.runtime.diagram.ui.resources.editor.parts.DiagramDocumentEditor.
If I click RMB on some node on diagram, then default popup appears. For a specific node I would like to hide all existing items in this popup menu and show only my contributed popup item. I use org.eclipse.ui.menus extension point to contribute my custom action. Should I use org.eclipse.gmf.runtime.common.ui.services.action.contributionItemProviders extension point and popupPredefiniedItem element for every already contributed action? What if some new plugin will contribute some new item, that I didn't hide this way? - it will be displayed.
2. I use org.eclipse.ui.commands extension point to define my custom action. MyActionHandler extends org.eclipse.core.commands.AbstractHandler. I would like to make popup action enabled depending on a selected node state. org.eclipse.core.commands.AbstractHandler has
method, but it isn't invoked when poup shows at first time.
public void setEnabled(Object evaluationContext)
What is the correct way to do this?
[Updated on: Tue, 03 June 2014 11:37]
Report message to a moderator
Powered by FUDForum
. Page generated in 0.01474 seconds