Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Eclipse Platform » Add menu to team in popup
Add menu to team in popup [message #632533] Wed, 13 October 2010 10:45 Go to next message
Mikael Petterson is currently offline Mikael PettersonFriend
Messages: 153
Registered: July 2009
Senior Member
Hi,

I worked with it for a while and I still cannot reproduce what I have in the actionSet menu ( whish I could post a picture but I cannot) in
<menuContribution
locationURI="popup:team.main?after=additions">

In this I want:
(Menu)
Checkout State> Reserved -->Unreserved (Submenu)
Unreserved-->Reserved (Submenu)

How do I add my menu with submenu's ?

br,

//mikael

Ps. Is it possible to pictures here?
Re: Add menu to team in popup [message #632714 is a reply to message #632533] Thu, 14 October 2010 04:03 Go to previous messageGo to next message
Animesh Kumar is currently offline Animesh KumarFriend
Messages: 79
Registered: September 2010
Location: Bangalore
Member
As much as i understood your usecase, you wanted to create a pop-up menu with sub menus. Here i have created a test project. You can add a menu contribution with locationURI- popup:org.eclipse.ui.popup.any?after=additions
so that menu appears everywhere in the workbench.
To the menu contribution you can add a menu to create the main menu item "Checkout State" then to create submenus you can add commands to the menu "Checkout State"
The following is a working code and i have tried it out:-

<?xml version="1.0" encoding="UTF-8"?>
<?eclipse version="3.4"?>
<plugin>
<extension
point="org.eclipse.ui.menus">
<menuContribution
allPopups="true"
locationURI="popup:org.eclipse.ui.popup.any?after=additions ">
<menu
label="Checkout State">
<command
commandId="Test.reservedToUnreservedCommand"
label="Reserved--&gt;Unreserved"
style="push">
</command>
<command
commandId="Test.unreservedToReservedCommand"
label="Unreserved--&gt;Reserved"
style="push">
</command>
</menu>
</menuContribution>
</extension>
<extension
point="org.eclipse.ui.commands">
<command
id="Test.checkoutCommand"
name="Checkout">
</command>
<command
id="Test.reservedToUnreservedCommand"
name="Reserved--&gt;Unreserved">
</command>
<command
id="Test.unreservedToReservedCommand"
name="Unreserved--&gt;Reserved">
</command>
</extension>
<extension
point="org.eclipse.ui.handlers">
<handler
class="test.handlers.CheckoutHandler"
commandId="Test.checkoutHandler">
</handler>
<handler
class="test.handlers.UnreservedHandler"
commandId="Test.handler3">
</handler>
<handler
class="test.handlers.ReservedHandler"
commandId="Test.reservedHandler">
</handler>
</extension>

</plugin>


Regards,
Animesh
Re: Add menu to team in popup [message #632859 is a reply to message #632714] Thu, 14 October 2010 13:59 Go to previous messageGo to next message
Mikael Petterson is currently offline Mikael PettersonFriend
Messages: 153
Registered: July 2009
Senior Member
Thanks for reply. I tested it and it looks ok.

However I cannot add it to the Team menu. How can it be done?

I tried the following:

<menuContribution allPopups="true" locationURI="popup:org.eclipse.ui.popup.any?team.main/group2 ">

but It does not show up in the Team menu.

Any ideas?

br,

//mikael
Re: Add menu to team in popup [message #632871 is a reply to message #632859] Thu, 14 October 2010 14:26 Go to previous messageGo to next message
Mikael Petterson is currently offline Mikael PettersonFriend
Messages: 153
Registered: July 2009
Senior Member
Just a slight correction:

it shows up but it is the submenus that is under the team.main/group2.

//mike
Re: Add menu to team in popup [message #633032 is a reply to message #632871] Fri, 15 October 2010 07:35 Go to previous messageGo to next message
Animesh Kumar is currently offline Animesh KumarFriend
Messages: 79
Registered: September 2010
Location: Bangalore
Member
Am not sure about it but in your menu contribution add "Checkout Counter" which was your main item in the menu as a menu item i.e., Right Click on menu contribution-> new->menu whereas the sub menu items can be added by adding commands to menu.
Try it out, i still haven't checked it.


Regards,
Animesh
Re: Add menu to team in popup [message #633121 is a reply to message #633032] Fri, 15 October 2010 12:40 Go to previous message
Mikael Petterson is currently offline Mikael PettersonFriend
Messages: 153
Registered: July 2009
Senior Member
Yes I understand how to do what you say but it is sadly not what I want. I want to use the existing popupmenu with "Team"-menu and add my new Menu ,"Checkout State" and under that have 2 sub menus.

br,

//mike
Previous Topic:Force re-evaluation of handler enabledWhen expressions from Handler (eclipse 3.3)
Next Topic:Annoying parameters, methods autocompletes
Goto Forum:
  


Current Time: Sat Dec 20 23:15:34 GMT 2014

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

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