Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Eclipse Platform » Create a submenu with 2 menu items under Team in popupMenu
icon9.gif  Create a submenu with 2 menu items under Team in popupMenu [message #556974] Fri, 03 September 2010 13:18 Go to next message
Mikael Petterson is currently offline Mikael PettersonFriend
Messages: 153
Registered: July 2009
Senior Member
Hi,

I have been struggling with this for a while.
When I have a resource selected and right click I get the popupMenu. In the popupMenu I want to add:

Team
Checkedout State
Reserved --> Unreserved
Unreserved --> Reserved

I have the following in my plugin.xml but MenuItem "Checkedout State" does not appear under the team menu ( and of course the other two does not either). Here is how my plugin.xml looks like:

<extension point="org.eclipse.ui.popupMenus">
		<objectContribution objectClass="org.eclipse.core.resources.IResource"
			adaptable="true" id="net.sourceforge.eclipseccase.popups.BuiltIn">
			<visibility>
				<pluginState value="activated" id="net.sourceforge.eclipseccase">
				</pluginState>
			</visibility>
			<filter name="projectPersistentProperty"
				value="org.eclipse.team.core.repository=net.sourceforge.eclipseccase.ClearCaseProvider">
			</filter>

			<action class="net.sourceforge.eclipseccase.ui.actions.UpdateAction"
				icon="icons/full/update.png" id="net.sourceforge.eclipseccase.popups.update"
				label="Update" menubarPath="team.main/group1">
			</action>
			<action class="net.sourceforge.eclipseccase.ui.actions.DeleteAction"
				icon="icons/full/delete.png" id="net.sourceforge.eclipseccase.popups.delete"
				label="Delete" menubarPath="team.main/group1">
			</action>
			<action
				class="net.sourceforge.eclipseccase.ui.actions.AddToClearCaseAction"
				icon="icons/full/add.png" id="net.sourceforge.eclipseccase.popups.add"
				label="Add" menubarPath="team.main/group1">
			</action>
			<action class="net.sourceforge.eclipseccase.ui.actions.RefreshStateAction"
				icon="icons/full/refresh_state.png" id="net.sourceforge.eclipseccase.popups.refresh"
				label="Refresh State" menubarPath="team.main/group1">
			</action>
			<action class="net.sourceforge.eclipseccase.ui.actions.UnHijackAction"
				icon="icons/full/unhijack.png" id="net.sourceforge.eclipseccase.popups.unhijack"
				label="UnHi&amp;jack" menubarPath="team.main/group1">
			</action>
			<action class="net.sourceforge.eclipseccase.ui.actions.UndoCheckOutAction"
				icon="icons/full/uncheckout.png" id="net.sourceforge.eclipseccase.popups.uncheckout"
				label="Uncheckout" menubarPath="team.main/group1">
			</action>
			<action class="net.sourceforge.eclipseccase.ui.actions.CheckInAction"
				icon="icons/full/checkin.png" id="net.sourceforge.eclipseccase.popups.checkin"
				label="Checkin" menubarPath="team.main/group1">
			</action>
			<action class="net.sourceforge.eclipseccase.ui.actions.CheckOutAction"
				icon="icons/full/checkout.png" id="net.sourceforge.eclipseccase.popups.checkout"
				label="Checkout" menubarPath="team.main/group1">
			</action>
			<action
				class="net.sourceforge.eclipseccase.ui.actions.ExternalUpdateAction"
				icon="icons/full/database_refresh.png" id="net.sourceforge.eclipseccase.popups.externalupdate"
				label="Update (external tool)" menubarPath="team.main/group2">
			</action>
			<action
				class="net.sourceforge.eclipseccase.ui.actions.CompareWithPredecessorAction"
				icon="icons/full/diff.png" id="net.sourceforge.eclipseccase.popups.comparepredecessor2"
				label="Predecessor" menubarPath="compareWithMenu/compareWithGroup">
			</action>
			<action class="net.sourceforge.eclipseccase.ui.actions.GetConfigSpecAction"
				icon="icons/full/get.png" id="net.sourceforge.eclipseccase.popups.getConfigSpec"
				label="Get/Edit &amp;Config Spec" menubarPath="team.main/group2">
			</action>
			<action class="net.sourceforge.eclipseccase.ui.actions.MkBrTypeAction"
				icon="icons/full/branch.png" id="net.sourceforge.eclipseccase.popups.mkbrtype"
				label="Make &amp;Branch Type" menubarPath="team.main/group2">
			</action>
			<action class="net.sourceforge.eclipseccase.ui.actions.FindMergeAction"
				icon="icons/full/findMerge.png" id="net.sourceforge.eclipseccase.popups.findmerge"
				label="Find Merge (Rebase, external tool)" menubarPath="team.main/group2">
			</action>
			<action class="net.sourceforge.eclipseccase.ui.actions.HistoryAction"
				icon="icons/full/history.png" id="net.sourceforge.eclipseccase.popups.history"
				label="&amp;History" menubarPath="team.main/group2">
			</action>
			<action class="net.sourceforge.eclipseccase.ui.actions.VersionTreeAction"
				icon="icons/full/tree.png" id="net.sourceforge.eclipseccase.popups.versiontree"
				label="Version Tree (external tool)" menubarPath="team.main/group2">
			</action>
			<action
				class="net.sourceforge.eclipseccase.ui.actions.BranchSearchViewAction"
				icon="icons/full/clearcase.png" id="net.sourceforge.eclipseccase.popups.branchsearch"
				label="Search File in Branch" menubarPath="team.main/group2">
			</action>
			<action
				class="net.sourceforge.eclipseccase.ui.actions.DescribeVersionAction"
				icon="icons/full/describe.png" id="net.sourceforge.eclipseccase.popups.describeversion"
				label="Describe Version (external tool)" menubarPath="team.main/group2">
			</action>
			<action
				class="net.sourceforge.eclipseccase.ui.actions.CompareWithPredecessorAction"
				icon="icons/full/diff.png" id="net.sourceforge.eclipseccase.popups.comparepredecessor"
				label="Compare with Predecessor (external tool)" menubarPath="team.main/group2">
			</action>
			<menu id="net.sourceforge.eclipseccase.ui.popups.checkedoutstate"
				label="Checkedout State" icon="icons/full/checkedout.png" path="team.main/group2">
				<separator name="res2unres" />
				<separator name="unres2res" />
			</menu>
			<action
				class="net.sourceforge.eclipseccase.ui.actions.CheckoutToUnreservedAction"
				id="net.sourceforge.eclipseccase.ui.popups.checkouttounreserved"
				label="Reserved --&gt;Unreserved"
				menubarPath="net.sourceforge.eclipseccase.ui.popups.checkedoutstate/res2unres">
			</action>
			<action
				class="net.sourceforge.eclipseccase.ui.actions.CheckoutToReservedAction"
				id="net.sourceforge.eclipseccase.ui.popups.checkouttoreserved"
				label=" Unreserved--&gt;Reserved"
				menubarPath="net.sourceforge.eclipseccase.ui.popups.checkedoutstate/unres2res">
			</action>
			<action class="net.sourceforge.eclipseccase.ui.actions.HistoryAction"
				icon="icons/full/history.png" id="net.sourceforge.eclipseccase.popups.history"
				label="&amp;ClearCase History" menubarPath="compareWithMenu/compareWithGroup">
			</action>
			<action class="net.sourceforge.eclipseccase.ui.actions.VersionTreeAction"
				icon="icons/full/tree.png" id="net.sourceforge.eclipseccase.popups.versiontree"
				label="Version Tree (external tool)" menubarPath="compareWithMenu/compareWithGroup">
			</action>
		</objectContribution>
	</extension>

Re: Create a submenu with 2 menu items under Team in popupMenu [message #557632 is a reply to message #556974] Wed, 08 September 2010 11:50 Go to previous messageGo to next message
Paul Webster is currently offline Paul WebsterFriend
Messages: 6859
Registered: July 2009
Location: Ottawa
Senior Member

Mikael Petterson wrote:
> Hi,
>
> I have been struggling with this for a while.
> When I have a resource selected and right click I get the popupMenu. In
> the popupMenu I want to add:
>
> Team
> Checkedout State
> Reserved --> Unreserved
> Unreserved --> Reserved
>
> I have the following in my plugin.xml but MenuItem "Checkedout State"
> does not appear under the team menu ( and of course the other two does
> not either). Here is how my plugin.xml looks like:
>
> <extension point="org.eclipse.ui.popupMenus">
> <objectContribution
> objectClass="org.eclipse.core.resources.IResource"
> adaptable="true"
> id="net.sourceforge.eclipseccase.popups.BuiltIn">

If you are going to try this:

> <menu
> id="net.sourceforge.eclipseccase.ui.popups.checkedoutstate"
> label="Checkedout State"
> icon="icons/full/checkedout.png" path="team.main/group2">
> <separator name="res2unres" />
> <separator name="unres2res" />
> </menu>
> <action
>
> class=" net.sourceforge.eclipseccase.ui.actions.CheckoutToUnreserved Action "
>
> id="net.sourceforge.eclipseccase.ui.popups.checkouttounreserved "
> label="Reserved -->Unreserved"
>
> menubarPath=" net.sourceforge.eclipseccase.ui.popups.checkedoutstate/res2u nres ">


it seems to me your menubarPath will be
" team.main/net.sourceforge.eclipseccase.ui.popups.checkedouts tate/res2unres "

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: Create a submenu with 2 menu items under Team in popupMenu [message #557661 is a reply to message #557632] Wed, 08 September 2010 13:06 Go to previous messageGo to next message
Mikael Petterson is currently offline Mikael PettersonFriend
Messages: 153
Registered: July 2009
Senior Member
Hi,

I tried your suggestion but SubMenu, "Checkedout State", is not visible under Team. And of course the other two "Reserved --&gt;Unreserved" and "Unreserved--&gt;Reserved" does not show.
I cannot understand what I am doing wrong. Is it that complicated?

br,

//mike

<extension point="org.eclipse.ui.popupMenus">
		<objectContribution objectClass="org.eclipse.core.resources.IResource"
			adaptable="true" id="net.sourceforge.eclipseccase.popups.BuiltIn">
			<visibility>
				<pluginState value="activated" id="net.sourceforge.eclipseccase">
				</pluginState>
			</visibility>
			<filter name="projectPersistentProperty"
				value="org.eclipse.team.core.repository=net.sourceforge.eclipseccase.ClearCaseProvider">
			</filter>

			<action class="net.sourceforge.eclipseccase.ui.actions.UpdateAction"
				icon="icons/full/update.png" id="net.sourceforge.eclipseccase.popups.update"
				label="Update" menubarPath="team.main/group1">
			</action>
			<action class="net.sourceforge.eclipseccase.ui.actions.DeleteAction"
				icon="icons/full/delete.png" id="net.sourceforge.eclipseccase.popups.delete"
				label="Delete" menubarPath="team.main/group1">
			</action>
			<action
				class="net.sourceforge.eclipseccase.ui.actions.AddToClearCaseAction"
				icon="icons/full/add.png" id="net.sourceforge.eclipseccase.popups.add"
				label="Add" menubarPath="team.main/group1">
			</action>
			<action class="net.sourceforge.eclipseccase.ui.actions.RefreshStateAction"
				icon="icons/full/refresh_state.png" id="net.sourceforge.eclipseccase.popups.refresh"
				label="Refresh State" menubarPath="team.main/group1">
			</action>
			<action class="net.sourceforge.eclipseccase.ui.actions.UnHijackAction"
				icon="icons/full/unhijack.png" id="net.sourceforge.eclipseccase.popups.unhijack"
				label="UnHi&amp;jack" menubarPath="team.main/group1">
			</action>
			<action class="net.sourceforge.eclipseccase.ui.actions.UndoCheckOutAction"
				icon="icons/full/uncheckout.png" id="net.sourceforge.eclipseccase.popups.uncheckout"
				label="Uncheckout" menubarPath="team.main/group1">
			</action>
			<action class="net.sourceforge.eclipseccase.ui.actions.CheckInAction"
				icon="icons/full/checkin.png" id="net.sourceforge.eclipseccase.popups.checkin"
				label="Checkin" menubarPath="team.main/group1">
			</action>
			<action class="net.sourceforge.eclipseccase.ui.actions.CheckOutAction"
				icon="icons/full/checkout.png" id="net.sourceforge.eclipseccase.popups.checkout"
				label="Checkout" menubarPath="team.main/group1">
			</action>
			<action
				class="net.sourceforge.eclipseccase.ui.actions.ExternalUpdateAction"
				icon="icons/full/database_refresh.png" id="net.sourceforge.eclipseccase.popups.externalupdate"
				label="Update (external tool)" menubarPath="team.main/group2">
			</action>
			<action
				class="net.sourceforge.eclipseccase.ui.actions.CompareWithPredecessorAction"
				icon="icons/full/diff.png" id="net.sourceforge.eclipseccase.popups.comparepredecessor2"
				label="Predecessor" menubarPath="compareWithMenu/compareWithGroup">
			</action>
			<action class="net.sourceforge.eclipseccase.ui.actions.GetConfigSpecAction"
				icon="icons/full/get.png" id="net.sourceforge.eclipseccase.popups.getConfigSpec"
				label="Get/Edit &amp;Config Spec" menubarPath="team.main/group2">
			</action>
			<action class="net.sourceforge.eclipseccase.ui.actions.MkBrTypeAction"
				icon="icons/full/branch.png" id="net.sourceforge.eclipseccase.popups.mkbrtype"
				label="Make &amp;Branch Type" menubarPath="team.main/group2">
			</action>
			<action class="net.sourceforge.eclipseccase.ui.actions.FindMergeAction"
				icon="icons/full/findMerge.png" id="net.sourceforge.eclipseccase.popups.findmerge"
				label="Find Merge (Rebase, external tool)" menubarPath="team.main/group2">
			</action>
			<action class="net.sourceforge.eclipseccase.ui.actions.HistoryAction"
				icon="icons/full/history.png" id="net.sourceforge.eclipseccase.popups.history"
				label="&amp;History" menubarPath="team.main/group2">
			</action>
			<action class="net.sourceforge.eclipseccase.ui.actions.VersionTreeAction"
				icon="icons/full/tree.png" id="net.sourceforge.eclipseccase.popups.versiontree"
				label="Version Tree (external tool)" menubarPath="team.main/group2">
			</action>
			<action
				class="net.sourceforge.eclipseccase.ui.actions.BranchSearchViewAction"
				icon="icons/full/clearcase.png" id="net.sourceforge.eclipseccase.popups.branchsearch"
				label="Search File in Branch" menubarPath="team.main/group2">
			</action>
			<action
				class="net.sourceforge.eclipseccase.ui.actions.DescribeVersionAction"
				icon="icons/full/describe.png" id="net.sourceforge.eclipseccase.popups.describeversion"
				label="Describe Version (external tool)" menubarPath="team.main/group2">
			</action>
			<action
				class="net.sourceforge.eclipseccase.ui.actions.CompareWithPredecessorAction"
				icon="icons/full/diff.png" id="net.sourceforge.eclipseccase.popups.comparepredecessor"
				label="Compare with Predecessor (external tool)" menubarPath="team.main/group2">
			</action>
			<!-- mike 20100903 In popupMenus it does not follow the same concept as actionSet. As a workaround
			     I will put the menus under Team and group2. Not nice but it works.-->
			<menu id="net.sourceforge.eclipseccase.ui.popups.checkedoutstate"
				label="Checkedout State" icon="icons/full/checkedout.png" path="team.main/group2">
				<separator name="res2unres"/>
				<separator name="unres2res"/>
			</menu> 
			<action
				class="net.sourceforge.eclipseccase.ui.actions.CheckoutToUnreservedAction"
				id="net.sourceforge.eclipseccase.ui.popups.checkouttounreserved"
				label="Reserved --&gt;Unreserved"
				icon="icons/full/unreserve.png"
				menubarPath="team.main/net.sourceforge.eclipseccase.ui.popups.checkedoutstate/res2unres">
			</action>
			<action
				class="net.sourceforge.eclipseccase.ui.actions.CheckoutToReservedAction"
				id="net.sourceforge.eclipseccase.ui.popups.checkouttoreserved"
				label=" Unreserved--&gt;Reserved"
				icon="icons/full/reserve.png"
				menubarPath="team.main/net.sourceforge.eclipseccase.ui.popups.checkedoutstate/unres2res">
			</action>
			<action class="net.sourceforge.eclipseccase.ui.actions.HistoryAction"
				icon="icons/full/history.png" id="net.sourceforge.eclipseccase.popups.history"
				label="&amp;ClearCase History" menubarPath="compareWithMenu/compareWithGroup">
			</action>
			<action class="net.sourceforge.eclipseccase.ui.actions.VersionTreeAction"
				icon="icons/full/tree.png" id="net.sourceforge.eclipseccase.popups.versiontree"
				label="Version Tree (external tool)" menubarPath="compareWithMenu/compareWithGroup">
			</action>
		</objectContribution>
	</extension>
Re: Create a submenu with 2 menu items under Team in popupMenu [message #557907 is a reply to message #557661] Thu, 09 September 2010 11:52 Go to previous messageGo to next message
Paul Webster is currently offline Paul WebsterFriend
Messages: 6859
Registered: July 2009
Location: Ottawa
Senior Member

Mikael Petterson wrote:
> Hi,
>
> I tried your suggestion but SubMenu, "Checkedout State", is not visible
> under Team. And of course the other two "Reserved -->Unreserved" and
> "Unreserved-->Reserved" does not show. I cannot understand what I am
> doing wrong. Is it that complicated?

You didn't mention there were errors in your error log:

!ENTRY org.eclipse.ui 4 4 2010-09-09 07:50:08.966
!MESSAGE Plugin 'z.ex.popup' invalid Menu Extension (Path 'team.main' is
invalid): net.sourceforge.eclipseccase.ui.popups.checkedoutstate

!ENTRY org.eclipse.ui 4 4 2010-09-09 07:50:08.971
!MESSAGE Plug-in 'z.ex.popup' contributed an invalid Menu Extension
(Path:
'team.main/net.sourceforge.eclipseccase.ui.popups.checkedout state' is
invalid): net.sourceforge.eclipseccase.ui.popups.checkouttounreserved

!ENTRY org.eclipse.ui 4 4 2010-09-09 07:50:08.973
!MESSAGE Plug-in 'z.ex.popup' contributed an invalid Menu Extension
(Path:
'team.main/net.sourceforge.eclipseccase.ui.popups.checkedout state' is
invalid): net.sourceforge.eclipseccase.ui.popups.checkouttoreserved


Apparently objectContributions menus cannot depend on other
objectContributions (which makes sense, actionSets can't reliably depend
on other actionSets). objectContributions work by processing all of the
menus first, and then the actions second (that's why your action can see
team.main, but your menu cannot).

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: Create a submenu with 2 menu items under Team in popupMenu [message #557967 is a reply to message #557907] Thu, 09 September 2010 16:03 Go to previous messageGo to next message
Mikael Petterson is currently offline Mikael PettersonFriend
Messages: 153
Registered: July 2009
Senior Member
Hi Paul,

What a great service. I guess you installed the plugin and check the log. Thanks.
So the <menu> should be before <action> otherwise it will not be visible. I could not have figured that one out myself Razz
Anyway. That was great help.

Thanks!

Have a nice day.

//mike
Re: Create a submenu with 2 menu items under Team in popupMenu [message #558166 is a reply to message #557661] Fri, 10 September 2010 11:57 Go to previous messageGo to next message
Mikael Petterson is currently offline Mikael PettersonFriend
Messages: 153
Registered: July 2009
Senior Member
I tried to move the <menu> tag before <action> inside <objectContribution> but the menus are still not visible.

//mike
Re: Create a submenu with 2 menu items under Team in popupMenu [message #558543 is a reply to message #558166] Mon, 13 September 2010 12:39 Go to previous messageGo to next message
Paul Webster is currently offline Paul WebsterFriend
Messages: 6859
Registered: July 2009
Location: Ottawa
Senior Member

Mikael Petterson wrote:
> I tried to move the <menu> tag before <action> inside
> <objectContribution> but the menus are still not visible.

I'm saying that you cannot have a menu depend on a menu from another
objectContribution.

But, you could use org.eclipse.ui.menus to add that menu using
popup:team.main.

Then it should be available

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: Create a submenu with 2 menu items under Team in popupMenu [message #558555 is a reply to message #558543] Mon, 13 September 2010 13:27 Go to previous messageGo to next message
Mikael Petterson is currently offline Mikael PettersonFriend
Messages: 153
Registered: July 2009
Senior Member
yes I misunderstood you. But I think I know how to solve it now.
I will give it a try very soon.
Thanks a lot you have been very helpful.


//mike
Re: Create a submenu with 2 menu items under Team in popupMenu [message #631350 is a reply to message #558555] Thu, 07 October 2010 08:05 Go to previous 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
Previous Topic:Where does Eclipse store other workspaces?
Next Topic:Toggle View in Eclipse
Goto Forum:
  


Current Time: Sat Nov 29 01:31:08 GMT 2014

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

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