How to get rid of debug as, run as, validate from my custom editor plugin.
I am extending structuredtexteditor in custom editor .
on right click of editor its showing many unusable context menu option .
@Override
public void editorContextMenuAboutToShow(IMenuManager menu) {
ISelectionProvider arg1=super.getSelectionProvider();
MenuManager menuMgr = new MenuManager("#PopupMenu");
getEditorPart().getEditorSite().registerContextMenu(menuMgr, arg1);
menu.removeAll();
menu.update(true);
menu.setVisible(false);
}
and remove all the contribution but still is showing some context menu option like run as, debug as,validate,profile as ,team as etc.
How would I get rid of that?
You can exclude them from your launch configuration when you start the debugging instance of Eclipse. Those menu items are contributed by other plugins, so to not see them you should not have those plugins active.
If the user of your plugin has those plugins installed in his Eclipse instance, then he will always see those menu items. There is nothing you can do against that, as an Eclipse installation is basically a loosely coupled random collection of plugins. And you should not even try to hide those menu items from code. You also don’t want that any other plugin developer tries to hide your contributions (menu items, toolbar buttons, …) to the workbench.