Hide "Run" menu (already using activities) [message #507872] |
Thu, 14 January 2010 23:03  |
Eclipse User |
|
|
|
Hello.
My RCP application depends on many Eclipse plugins. One of them contributes a "Run" menu that I can't get rid of.
I use the activities extension point to hide all that stuff from the other plugins, but even if I simply hide everything (by using an activity pattern ".*") an empty "Run" menu remains.
How do I hide that one?
Regards,
Kai
|
|
|
|
Re: Hide "Run" menu (already using activities) [message #508234 is a reply to message #508021] |
Sun, 17 January 2010 23:35   |
Eclipse User |
|
|
|
Hi Niels.
I took the time to clear up the plugin dependencies of my RCP app and the "Run" menu was gone. So I don't have a solution for you, sorry. I am also still not exactly sure what plugin contributed that menu and why it wasn't possible to hide it by using activities.
Regards,
Kai
Niels Hoffmann wrote on Fri, 15 January 2010 10:15 | I am having the exact same problem. Please post if you already found a solution.
Cheers,
Niels
|
|
|
|
|
Re: Hide "Run" menu (already using activities) [message #514693 is a reply to message #512428] |
Tue, 16 February 2010 11:18   |
Eclipse User |
|
|
|
I had the same problem. I too could see it was related to "org.eclipse.debug.ui".
However in my case the Run menu appeared because one of my own plugins had a dependency to "org.eclipse.ui.externaltools".
My solution so far:
1. Remove the dependency to "org.eclipse.ui.externaltools" (located in MANIFEST.MF)
2. Open the Run Configuration goto to the Plug-ins tab and click "Deselect All", press "Apply" and click "Add Required Plug-ins".
3. Press "Apply" and try to run it again.
Finally no annoying Run menu for me.
|
|
|
Re: Hide "Run" menu (already using activities) [message #514729 is a reply to message #514693] |
Tue, 16 February 2010 13:40   |
Eclipse User |
|
|
|
It would appear that because I included the Plugin Spy in my RCP app - the plugin org.eclipse.ui.externaltools is also loaded at runtime. This gives me the "Run" menu.
I tried to get rid of the menu using the "org.eclipse.ui.activities" extension, with the pattern "org.eclipse.ui.run" - but I could not get it to work.
So I ended up fixing this programmatically. The code below removes all menu items with the id "org.eclipse.ui.run".
It works OK - but I would rather do this in the "org.eclipse.ui.activities" extension.
ApplicationWorkbenchWindowAdvisor.java
@Override
public void postWindowOpen()
{
super.postWindowOpen();
IWorkbenchWindowConfigurer workbenchWindowConfigurer = getWindowConfigurer();
IActionBarConfigurer actionBarConfigurer = workbenchWindowConfigurer.getActionBarConfigurer();
IMenuManager menuManager = actionBarConfigurer.getMenuManager();
IContributionItem[] menuItems = menuManager.getItems();
for ( int i = 0; i < menuItems.length; i++ )
{
IContributionItem menuItem = menuItems[i];
// Hack to remove the Run menu - it seems you cannot do this using the
// "org.eclipse.ui.activities" extension
if ("org.eclipse.ui.run".equals(menuItem.getId())) {
menuManager.remove(menuItem);
}
}
menuManager.update(true);
}
|
|
|
Re: Hide "Run" menu (already using activities) [message #631648 is a reply to message #507872] |
Fri, 08 October 2010 11:02   |
Eclipse User |
|
|
|
Create a perspectiveExtension extension (org.eclipse.ui.perspectiveExtensions) targeting your application perspective then add a "hiddenMenuItem" element to it with the id "org.eclipse.ui.run".
In your application perspective, the "Run" menu item will be hidden.
|
|
|
Re: Hide "Run" menu (already using activities) [message #657086 is a reply to message #507872] |
Tue, 01 March 2011 15:07   |
Eclipse User |
|
|
|
Quote: | Create a perspectiveExtension extension (org.eclipse.ui.perspectiveExtensions) targeting your application perspective then add a "hiddenMenuItem" element to it with the id "org.eclipse.ui.run".
In your application perspective, the "Run" menu item will be hidden.
|
I tried this to hide the search menu:
<extension point="org.eclipse.ui.perspectiveExtensions">
<perspectiveExtension targetID="com.exoanalytic.seas.SEASPerspective">
<hiddenMenuItem id="org.eclipse.search.menu">
</hiddenMenuItem>
</perspectiveExtension>
</extension>
But to no avail...the Search menu still appears. The lack of clarity when trying to control unwanted contributions can be quite frustrating...
|
|
|
|
Powered by
FUDForum. Page generated in 0.04925 seconds