Skip to main content



      Home
Home » Eclipse Projects » Eclipse Platform » Add menu to team in popup
Add menu to team in popup [message #632533] Wed, 13 October 2010 06:45 Go to next message
Eclipse UserFriend
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 00:03 Go to previous messageGo to next message
Eclipse UserFriend
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>
Re: Add menu to team in popup [message #632859 is a reply to message #632714] Thu, 14 October 2010 09:59 Go to previous messageGo to next message
Eclipse UserFriend
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 10:26 Go to previous messageGo to next message
Eclipse UserFriend
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 03:35 Go to previous messageGo to next message
Eclipse UserFriend
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.
Re: Add menu to team in popup [message #633121 is a reply to message #633032] Fri, 15 October 2010 08:40 Go to previous message
Eclipse UserFriend
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 Jul 12 17:54:21 EDT 2025

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

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

Back to the top