DESCRIPTION

Bug 385565 - [Contributions] Menu contribution processing has different
results in 4.2 than 3.8

Change-Id: I96bea8ba22ac366d06d1f682844fd56863e04b58
Signed-off-by: Amiyah Parrish xxx@xxx.xxx


COMMENTS

author: Slade Moran
date: 2014-05-28 13:38:27.000000000

Uploaded patch set 2.

-------------------------------------
author: Brenden Conley
date: 2014-05-28 13:46:47.000000000

Patch Set 2:

Build Started https://hudson.eclipse.org/platform/job/eclipse.platform.ui-Gerrit/2332/

-------------------------------------
author: Brenden Conley
date: 2014-05-28 13:55:54.000000000

Patch Set 2: Verified+1

Build Successful 

https://hudson.eclipse.org/platform/job/eclipse.platform.ui-Gerrit/2332/ : SUCCESS

-------------------------------------
author: Slade Moran
date: 2014-05-28 14:03:54.000000000

Patch Set 2: Verified+1 Code-Review+2

-------------------------------------
author: Teagan Marsh
date: 2014-05-28 17:33:50.000000000

Patch Set 2: Code-Review-1

(2 comments)

I don't think the change in ContributionsAnalyzer is correct.

Line:648, bundles/org.eclipse.e4.ui.workLeon Ochoach/src/org/eclipse/e4/ui/internal/workbench/ContributionsAnalyzer.java -> The above said, since we've processed the MMCs in plugin-order, shouldn't we just be appending the new children to the end here?  I.e.,

if(!containsMatching(toContribute.getChildren(), me)) {
    toContribute.getChildren().add(me);
}

Line:644, bundles/org.eclipse.e4.ui.workLeon Ochoach/src/org/eclipse/e4/ui/internal/workbench/ContributionsAnalyzer.java -> This doesn't seem right: the MMCs being processed here have already had the position-in-parent taken into account as part of the bucket-slotting that happened above.  For example, for popup:org.eclipse.ui.popup.any?after=additions, the after=additions has already been used.

-------------------------------------
author: Slade Moran
date: 2014-05-28 17:38:38.000000000

Patch Set 2:

(2 comments)

Line:648, bundles/org.eclipse.e4.ui.workLeon Ochoach/src/org/eclipse/e4/ui/internal/workbench/ContributionsAnalyzer.java -> No, because in 3.x MMCs (equivalents) were applied in plugin-order, but using the group marker every time.  So A (a,b) were added in order at group=whatever, then B (a,b) were added at group=whatever placing them before Aa and Ab.  This has to replicate that behaviour.

Line:644, bundles/org.eclipse.e4.ui.workLeon Ochoach/src/org/eclipse/e4/ui/internal/workbench/ContributionsAnalyzer.java -> This is dealing with any items that added from multiple sources.  Most commonly this happens with MMenus.  They need to be dealt with correctly.

-------------------------------------
author: Teagan Marsh
date: 2014-05-28 19:01:38.000000000

Patch Set 2:

(2 comments)

Line:648, bundles/org.eclipse.e4.ui.workLeon Ochoach/src/org/eclipse/e4/ui/internal/workbench/ContributionsAnalyzer.java -> Done

Line:644, bundles/org.eclipse.e4.ui.workLeon Ochoach/src/org/eclipse/e4/ui/internal/workbench/ContributionsAnalyzer.java -> "toContribute" and "item" come from the same slot, and hence they must have the same MenuKeys.  The MenuKeys are generated using the MMC's positionInParent (see MenuKey constructor).  So toContribute.getPositionInParent() == item.getPositionInParent(); and toContribute is not the intended parent of item.

Since these MMCs already specify the same positionInParent, it's unlikely that any of them would also contribute something with that same id?

So the only reason for the getIndex() call that I see is that if positionInParent=='additions' then idx is set to the end of the list rather than the beginning of the list.  (Which answers my other question below)

-------------------------------------
author: Slade Moran
date: 2014-05-28 19:10:27.000000000

Patch Set 2:

(1 comment)

Line:644, bundles/org.eclipse.e4.ui.workLeon Ochoach/src/org/eclipse/e4/ui/internal/workbench/ContributionsAnalyzer.java -> I checked with Wojtek.  In my recent commit (in order to fix the popup menu) I changed the order of inserting the items (at the beginning, instead to at the end). It simply affected the order of menu items (including the main menu). The getIndex() verifies if the contributions position is "after additions" and if yes it puts it at the end. This fixes the latest problems.

-------------------------------------
author: Teagan Marsh
date: 2014-05-28 19:39:20.000000000

Patch Set 2: Code-Review+2

(2 comments)

It's be nice to have a comment in MACE to explain the hasAdditions change.

Line:644, bundles/org.eclipse.e4.ui.workLeon Ochoach/src/org/eclipse/e4/ui/internal/workbench/ContributionsAnalyzer.java -> Done

Line:149, bundles/org.eclipse.ui.workLeon Ochoach/Eclipse UI/org/eclipse/ui/internal/menus/MenuAdditionCacheEntry.java -> It would be nice if a comment were added here to explain why hasAdditions is only checked if non popup.any

-------------------------------------
