Community
Participate
Working Groups
I have a popup menu that is to be shown for every object that implements ICElement. When I multi-select 2 items which implement ICElement but are hetrogeneous types, I am seeing 3 instances of each of my menu items. All I want/need is 1 instance. My xml looks like: <objectContribution objectClass="org.eclipse.cdt.core.model.ICElement" id="myPopup"> <menu label="%My_Menu_name" path="additions" id="myMenu"> <separator name="addToNew"> </separator> </menu> <action label="%Action1.actionLabel" class="com.ibm.xtools.viz.ui.internal.actions.AddToNewAction" menubarPath="myMenu/addToNew" id="addToNewAction"> </action> </objectContribution> When looking into the code, org.eclipse.ui.internal.ObjectActionContributorManager.contributeObjectActions (...) will calculate the common class and interfaces (in getCommonClasses). In my case, the 2 items selected implement ICElement but are different classes org.eclipse.cdt.internal.core.model.Enumeration and org.eclipse.cdt.internal.core.model.Structure. getCommonClasses identifies (correctly) the common classes/interfaces are: org.eclipse.cdt.internal.core.model.SourceManipulation org.eclipse.cdt.core.model.IVariableDeclaration org.eclipse.cdt.core.model.IDeclaration contributeObjectActions then iterates over these classes/iterations to determine contributors and adds them to the list. Each of these class/interfaces implement ICElement. So I end up with 3 contributors in the list of the same thing. What we think it should do is add a contributor to the list only if it is not already in the list.
It is important to us to have this fixed. The context menus are really ugly when the each menu contribution occurs 3 times for the selected elements. I was also not able to find any work around for this.
Sorry, figured out that I need to change Severity not priority (even though it is higher than P4 priority for us).
Upgrading to P2. If you have any suggestions about this please attach a patch.
A lot of this code has change. Is this still a problem?
I'm pretty sure this has been fixed. When I changed this code early in 3.0, I remember fixing some of these duplicate issues. Hey Heather works with us now, so we should ask her if she can still reproduce.
Heather: does this work for you now?
Yes it still occurs. Using CDT plugin, I created a project with a struct, enum and class. When I multi-select the three of them, the contribution described earlier occurs multiple times. I did an about and it says the versions of org.eclipse.ui are 3.0.2 & 3.0.1.
What happens if you test against a recent 3.1 build (e.g., N20050503-0010)?
Investigate for 3.2
Moving Dougs bugs
*** This bug has been marked as a duplicate of 133749 ***