How to disable all popup menu items? [message #1384954] |
Tue, 03 June 2014 09:34 |
Bartosz Popiela Messages: 21 Registered: March 2012 |
Junior Member |
|
|
Hi!
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 public void setEnabled(Object evaluationContext) method, but it isn't invoked when poup shows at first time.
What is the correct way to do this?
[Updated on: Tue, 03 June 2014 11:37] Report message to a moderator
|
|
|
|
Re: How to disable all popup menu items? [message #1385605 is a reply to message #1385536] |
Mon, 09 June 2014 21:22 |
Bartosz Popiela Messages: 21 Registered: March 2012 |
Junior Member |
|
|
Thank you for response!
Actually, above code contributes new submenu "My perfect menu" to existing popup.
What i want to achieve is to disable all items in existing popup:org.eclipse.gmf.runtime.diagram.ui.DiagramEditorContextMenu popup except my own contributions, if my context is set. I know that I can remove every item using org.eclipse.gmf.runtime.common.ui.services.action.contributionItemProviders extension point and popupPredefiniedItem element, and contribute my own items, but different plugins can contribute different menu items and I don't have list of all contributed menu items.
I set context using "org.eclipse.ui.contexts" extenstion point and use variable for statement.
[Updated on: Mon, 09 June 2014 21:23] Report message to a moderator
|
|
|
Powered by
FUDForum. Page generated in 0.02780 seconds