Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Eclipse Platform » [plugin] control the position of a command in the toolbar(locationURI with org.eclipse.debug.ui.launchActionSet)
[plugin] control the position of a command in the toolbar [message #551624] Sun, 08 August 2010 12:37 Go to next message
Eclipse User is currently offline Eclipse UserFriend
Messages: 34
Registered: July 2010
Member
Hello

I'm developing a plug-in and I've recently added a command button in the toolbar of eclipse . First I was working with actions and then I've been told that it's preferable to work with commands .

The problem is that I want my command to be placed in the group of ( debug, run , run last tool ) specifically at the end . I managed to do this with actions using this path :
Quote:

toolbarPath="org.eclipse.debug.ui.launchActionSet/debug"


I really don't know the equivalent of this path when working with commands
here is the code for the addition of the command :

<extension
         point="org.eclipse.ui.menus">
      <menuContribution
            locationURI="toolbar:org.eclipse.ui.main.toolbar">
         <toolbar
               id="org.eclipse.debug.ui.launchActionSet">
                              
         </toolbar>
      </menuContribution>
      <menuContribution
            locationURI="toolbar:org.eclipse.debug.ui.launchActionSet">
         <command
               commandId="id"
               icon="icons/.....png"
               label="label"
               style="push">
            <visibleWhen
                  checkEnabled="true">
            </visibleWhen>
         </command>
      </menuContribution>
   </extension>
   <extension
         point="org.eclipse.ui.commands">
      <command
            defaultHandler="idHandler"
            id="id"
            name="name">
      </command>
   </extension>


I want also to do the same thing for the Run menu and I have the same problem for the location .

Quote:
menubarPath="org.eclipse.ui.run/relaunchGroup"


what are the equivalents for the locationURI of my command ?

Thanks so much for your help Smile

[Updated on: Mon, 09 August 2010 08:30]

Report message to a moderator

Re: [plugin] control the position of a command in the toolbar [message #551965 is a reply to message #551624] Tue, 10 August 2010 10:13 Go to previous messageGo to next message
Prakash G.R. is currently offline Prakash G.R.Friend
Messages: 621
Registered: July 2009
Senior Member
On 08/08/10 6:07 PM, emna.lamine@ensi-bourges.fr wrote:
> Hello
> I'm developing a plug-in and I've recently added a command button in the
> toolbar of eclipse . First I was working with actions and then I've been
> told that it's preferable that I work with commands .
>
> The problem that I want my command to be placed in the group of ( debug,
> run , run last tool ) specifically at the end . I managed to do this
> with actions with this path :
> Quote:
>> toolbarPath="org.eclipse.debug.ui.launchActionSet/debug"

Eclipse supports before, after and endof. So the locationURL will be:
toolbar:<toolbar id>?endof=<separator id>

--
- Prakash
Platform UI Team, IBM

www.eclipse-tips.com
Re: [plugin] control the position of a command in the toolbar [message #551996 is a reply to message #551965] Tue, 10 August 2010 13:11 Go to previous messageGo to next message
Eclipse User is currently offline Eclipse UserFriend
Messages: 34
Registered: July 2010
Member
Hello !

thanks for your response ! I was despairing .
I tryed this :
locationURI="toolbar:org.eclipse.debug.ui.launchActionSet?endof=debug"


but it dosen't work either
Re: [plugin] control the position of a command in the toolbar [message #553139 is a reply to message #551624] Mon, 16 August 2010 14:36 Go to previous messageGo to next message
Paul Webster is currently offline Paul WebsterFriend
Messages: 6859
Registered: July 2009
Location: Ottawa
Senior Member

Menu contributions are applied before actionSets. That means if you
want to co-exist with an actionSet menu you must define the menu as a
menu contribution.

For the toolbar, in theory if you create a toolbar with the same id as
the actionSet toolbar, your item will show up there. You'll have to do
research to see what the actionSet toolbar looks like without your
contribution.

PW


--
Paul Webster
http://wiki.eclipse.org/Platform_Command_Framework
http://wiki.eclipse.org/Command_Core_Expressions
http://wiki.eclipse.org/Menu_Contributions
http://wiki.eclipse.org/Menus_Extension_Mapping
http://help.eclipse.org/galileo/index.jsp?topic=/org.eclipse .platform.doc.isv/guide/workbench.htm


Re: [plugin] control the position of a command in the toolbar [message #553216 is a reply to message #553139] Mon, 16 August 2010 17:12 Go to previous messageGo to next message
Eclipse User is currently offline Eclipse UserFriend
Messages: 34
Registered: July 2010
Member
hello Paul !

Thanks for your answer ! but sorry, I didn't understand what you mean Sad
I used the plug-in Menu spy ( alt+shift+F2 )
and I got this
toolbar:org.eclipse.debug.ui.launchActionSet?after=org.eclipse.debug.internal.ui.actions.DebugDropDownAction


Please explain me what should I do exactly and thanks so much
Re: [plugin] control the position of a command in the toolbar [message #553227 is a reply to message #553216] Mon, 16 August 2010 17:24 Go to previous messageGo to next message
Paul Webster is currently offline Paul WebsterFriend
Messages: 6859
Registered: July 2009
Location: Ottawa
Senior Member

Try creating a menu contribution that contains a toolbar with the same ID

PW

--
Paul Webster
http://wiki.eclipse.org/Platform_Command_Framework
http://wiki.eclipse.org/Command_Core_Expressions
http://wiki.eclipse.org/Menu_Contributions
http://wiki.eclipse.org/Menus_Extension_Mapping
http://help.eclipse.org/galileo/index.jsp?topic=/org.eclipse .platform.doc.isv/guide/workbench.htm


Re: [plugin] control the position of a command in the toolbar [message #553233 is a reply to message #553227] Mon, 16 August 2010 17:52 Go to previous messageGo to next message
Eclipse User is currently offline Eclipse UserFriend
Messages: 34
Registered: July 2010
Member

It isn't what I've done at first in my code Rolling Eyes ??
I didn't understand where what modifications should be done in my code Embarrassed
Re: [plugin] control the position of a command in the toolbar [message #553516 is a reply to message #553233] Tue, 17 August 2010 18:30 Go to previous message
Paul Webster is currently offline Paul WebsterFriend
Messages: 6859
Registered: July 2009
Location: Ottawa
Senior Member

emna.lamine@ensi-bourges.fr wrote:
>
> It isn't what I've done at first in my code :roll: ??
> I didn't understand where what modifications should be done in my code
> :blush:

the most control you can get in a system that interacts with both menu
contributions and actionSets is to create the toolbar and any groups in
the menuContribution. The (hopefully) won't get replicated when the
actionSet is visible.

You probably need to look at the toolbarPath of what is contributed to
the actionSet to guess what the groups in that actionSet toolbar are
going to be.

PW


--
Paul Webster
http://wiki.eclipse.org/Platform_Command_Framework
http://wiki.eclipse.org/Command_Core_Expressions
http://wiki.eclipse.org/Menu_Contributions
http://wiki.eclipse.org/Menus_Extension_Mapping
http://help.eclipse.org/galileo/index.jsp?topic=/org.eclipse .platform.doc.isv/guide/workbench.htm


Previous Topic:Apply a working set to a view?
Next Topic:[plugin ] problem with paths used in plugin
Goto Forum:
  


Current Time: Thu Jan 21 19:02:01 GMT 2021

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

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

Back to the top