[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [Newsgroup Home]
[news.eclipse.modeling.gmf] Re: Removing context menu items from diagram

Hi,

Thank you! This was very helpful! It did the trick for most of the menus i wanted to get rid of.
However I don't know how to remove specific menu items from certain menus. I will keep looking (example: removing the copy/paste from Edit, and keep the Duplicate menu item).
Thanks again for your help.


tamer


On 2009-02-08 01:41:52 -0800, Arne <Erazerx@xxxxxx> said:

Hi,

for some elements it works by adding a extension to the
contributionItemProviders extension point, making a popupContribution
and set remove to false. Here is an example for removing the add-group
and the navigate-group:

<extension
point="org.eclipse.gmf.runtime.common.ui.services.action.contributionItemProviders">
<contributionItemProvider


checkPluginLoaded="false" class="org.eclipse.gmf.runtime.diagram.ui.providers.DiagramContributionItemProvider">



<Priority name="Low"/>

      <popupContribution
             id="remove_popup_menu_id"
class="org.eclipse.gmf.runtime.diagram.ui.providers.DiagramContextMenuProvider">



<popupStructuredContributionCriteria objectClass="org.eclipse.gmf.runtime.diagram.ui.editparts.DiagramEditPart"> </popupStructuredContributionCriteria> <popupPredefinedItem id="navigateGroup" remove="true"/> <popupPredefinedItem id="addGroup" remove="true"/> </popupContribution> </contributionItemProvider> </extension>


The IDs for the popupPredefinedItem are defined in the class org.eclipse.gmf.runtime.diagram.ui.actions.ActionIds.

But i am not sure if this works for all context menu entries this way.





Tamer schrieb:
Hi,

I am wondering how to remove certain menu items from the default context
menu.
For example when I right click a node on my diagram there's an edit
section. What if I want to remove Copy/Paste and only keep Duplicate
from the Edit submenu? Or what if I want to remove the Filters submenu
altogether?

I would basically like to know where I should look in the code to
customize the context menu.
Thank you very much for your help.

tamer