Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Rich Client Platform (RCP) » Hide "Run" menu (already using activities)
Hide "Run" menu (already using activities) [message #507872] Thu, 14 January 2010 23:03 Go to next message
Kai Schlamp is currently offline Kai SchlampFriend
Messages: 344
Registered: July 2009
Senior Member
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 #508021 is a reply to message #507872] Fri, 15 January 2010 15:15 Go to previous messageGo to next message
Niels Hoffmann is currently offline Niels HoffmannFriend
Messages: 2
Registered: July 2009
Junior Member
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 #508234 is a reply to message #508021] Sun, 17 January 2010 23:35 Go to previous messageGo to next message
Kai Schlamp is currently offline Kai SchlampFriend
Messages: 344
Registered: July 2009
Senior Member
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 #512428 is a reply to message #508234] Fri, 05 February 2010 05:13 Go to previous messageGo to next message
Matt Seashore is currently offline Matt SeashoreFriend
Messages: 58
Registered: July 2009
Member
I've run into the same problem as well...it seems it's being contributed by the org.eclipse.debug.ui plugin as it goes away when not running with that plugin. That said, I still can't seem to remove the 'Run' menu using activities either. Sad
Re: Hide "Run" menu (already using activities) [message #514693 is a reply to message #512428] Tue, 16 February 2010 11:18 Go to previous messageGo to next message
hjembaek is currently offline hjembaekFriend
Messages: 5
Registered: February 2010
Junior Member
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 Go to previous messageGo to next message
hjembaek is currently offline hjembaekFriend
Messages: 5
Registered: February 2010
Junior Member
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 Go to previous messageGo to next message
Adi is currently offline AdiFriend
Messages: 1
Registered: October 2010
Junior Member
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 Go to previous messageGo to next message
Joey Mink is currently offline Joey MinkFriend
Messages: 87
Registered: July 2009
Location: Centreville, VA, USA
Member

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...
Re: Hide "Run" menu (already using activities) [message #897457 is a reply to message #657086] Tue, 24 July 2012 08:10 Go to previous message
Slawek L is currently offline Slawek LFriend
Messages: 21
Registered: May 2012
Junior Member
Overriding the WorkbenchWindowAdvisor's postWindowCreate method I succeded to hide the "Search" using this instruction:
PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActi vePage().hideActionSet( "org.eclipse.search.searchActionSet");
Previous Topic:Overriding only few of the Windows ShortKeys and keeping all other Eclipse key as it is in my RCP.
Next Topic:Installing plugin into eclipse using command line
Goto Forum:
  


Current Time: Mon Apr 15 03:53:31 GMT 2024

Powered by FUDForum. Page generated in 0.07409 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top