Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Plugin Development Environment (PDE) » Problem with contributing to Eclipse Search menu
Problem with contributing to Eclipse Search menu [message #68080] Mon, 13 July 2009 19:02 Go to next message
Lubos Pochman is currently offline Lubos Pochman
Messages: 29
Registered: July 2009
Junior Member
I am trying to make contribution to Eclipse Search menu, but my
command/menu item doesn't show in the Search menu. I use locationURI
menu:org.eclipse.search.menu?after=fileSearchConte xtMenuActionsGroup (or
after=additions), but item doesn't show in the Search menu.

If I move the command reference to my menu or to any other Eclipse menu
like menu:project, the menu item appears.

I do have org.eclipse.search in Dependencies.

Here is snippet from plugin.xml:

<menuContribution
locationURI="menu:org.eclipse.search.menu?after=fi
leSearchContextMenuActionsGroup">
<command
commandId="my.ui.plugin.commands.searchInScanResul tsCommand"
icon="icons/swirl.gif"
id="my.ui.plugin.menus.searchInScanResultsCommand "
mnemonic="R"
style="push">
</command>
</menuContribution>

I would appreciate any help. Thanks, Lubos
Re: Problem with contributing to Eclipse Search menu [message #68276 is a reply to message #68080] Thu, 16 July 2009 22:15 Go to previous messageGo to next message
Lubos Pochman is currently offline Lubos Pochman
Messages: 29
Registered: July 2009
Junior Member
I even tried to create test plugin from template "Hello World Command" and
just added org.eclipse.search dependency and following as
org.eclipse.ui.menu menuContribution with locationURI
menu:org.eclipse.search.menu?after=fileSearchContextMenuActi onsGroup

But nothing appears in Search menu.

<menuContribution

locationURI=" menu:org.eclipse.search.menu?after=fileSearchContextMenuActi onsGroup ">
<menu
id="test.plugin.menus.sampleMenu"
label="Sample Menu"
mnemonic="M">
<command
commandId="test.plugin.commands.sampleCommand"
id="test.plugin.menus.sampleCommand"
mnemonic="S">
</command>
</menu>
</menuContribution>
Re: Problem with contributing to Eclipse Search menu [message #68402 is a reply to message #68276] Sat, 18 July 2009 15:30 Go to previous messageGo to next message
Lubos Pochman is currently offline Lubos Pochman
Messages: 29
Registered: July 2009
Junior Member
After looking at org.eclipse.search source code, Eclipse Search menu
(org.eclipse.search.menu) doesn't support Command contributions, so you
cannot use org.eclipse.ui.menus extension point to make Search menu
contribution. You have to use action sets and org.eclipse.ui.actionSets
extension point and use menubarPath org.eclipse.search.menu/dialogGroup
(for example) for your action.
Re: Problem with contributing to Eclipse Search menu [message #599466 is a reply to message #68080] Thu, 16 July 2009 22:15 Go to previous messageGo to next message
Lubos Pochman is currently offline Lubos Pochman
Messages: 29
Registered: July 2009
Junior Member
I even tried to create test plugin from template "Hello World Command" and
just added org.eclipse.search dependency and following as
org.eclipse.ui.menu menuContribution with locationURI
menu:org.eclipse.search.menu?after=fileSearchContextMenuActi onsGroup

But nothing appears in Search menu.

<menuContribution

locationURI=" menu:org.eclipse.search.menu?after=fileSearchContextMenuActi onsGroup ">
<menu
id="test.plugin.menus.sampleMenu"
label="Sample Menu"
mnemonic="M">
<command
commandId="test.plugin.commands.sampleCommand"
id="test.plugin.menus.sampleCommand"
mnemonic="S">
</command>
</menu>
</menuContribution>
Re: Problem with contributing to Eclipse Search menu [message #599569 is a reply to message #68276] Sat, 18 July 2009 15:30 Go to previous messageGo to next message
Lubos Pochman is currently offline Lubos Pochman
Messages: 29
Registered: July 2009
Junior Member
After looking at org.eclipse.search source code, Eclipse Search menu
(org.eclipse.search.menu) doesn't support Command contributions, so you
cannot use org.eclipse.ui.menus extension point to make Search menu
contribution. You have to use action sets and org.eclipse.ui.actionSets
extension point and use menubarPath org.eclipse.search.menu/dialogGroup
(for example) for your action.
Re: Problem with contributing to Eclipse Search menu [message #648578 is a reply to message #68402] Thu, 13 January 2011 15:07 Go to previous messageGo to next message
Christoph Pohl is currently offline Christoph Pohl
Messages: 3
Registered: July 2009
Junior Member
Hi Lubos,

I tried using a sample actionSet (extension point="org.eclipse.ui.actionSets") with an action on menubarPath="org.eclipse.search.menu/dialogGroup" as you suggested - to no avail.

I wonder why JDT works as it works. The "tutorial" at http://wiki.eclipse.org/Menu_Contributions/Search_Menu is not really helpful.

I am desperate. :-/

Cheers,
Christoph
Re: Problem with contributing to Eclipse Search menu [message #648585 is a reply to message #68080] Thu, 13 January 2011 15:17 Go to previous message
Christoph Pohl is currently offline Christoph Pohl
Messages: 3
Registered: July 2009
Junior Member
What actually *does* work is redefining the whole Search Menu as in the workaround that is still currently used in JDT 3.6:

   <extension
         point="org.eclipse.ui.actionSets">
      <actionSet
            label="%JavaSearchActionSet.label"
            description="%JavaSearchActionSet.description"
            visible="false"
            id="org.eclipse.jdt.ui.SearchActionSet">
<!-- see http://bugs.eclipse.org/bugs/show_bug.cgi?id=15684    -->
<!-- Note: The menu (re-) definition has to be here due to bug: -->
<!-- =================================================================== -->
<!-- Search Menu                                                         -->
<!-- =================================================================== -->
         <menu
               label="%searchMenu.label"
               path="navigate"
               id="org.eclipse.search.menu">
				<groupMarker name="internalDialogGroup"/>   <!-- not to be used by clients  -->
				<groupMarker name="dialogGroup"/>           <!-- to be used by clients      -->
				<separator name="fileSearchContextMenuActionsGroup"/> <!-- to be used by clients      -->
	         	<separator name="contextMenuActionsGroup"/> <!-- to be used by clients -->
	         	<separator name="occurencesActionsGroup"/> <!-- to be used by clients -->
	         	<separator name="extraSearchGroup"/> <!-- to be used by clients -->
         </menu>
<!-- (...) -->


It seems like the 8-year-old bug https://bugs.eclipse.org/bugs/show_bug.cgi?id=15684 is still not really solved.
Previous Topic:Adding DropAdapter causes Widge is Disposed error
Next Topic:Calling a Wizard from a button
Goto Forum:
  


Current Time: Tue Oct 21 15:28:24 GMT 2014

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

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