DESCRIPTION

Bug 410426 - VisibleWhen from contribution factories not handled in
toolbars

ToolbarContributionRecord did not handle the factory case in
anyVisibleWhen() and always return false for contributions through
org.eclipse.ui.menus.ExtensionContributionFactory.

This commit also correct a ClassCastException in
ToolBarManagerRenderer.toBeRenderedUpdater EventHandler: the
IContributionItem is not always a ContributionItem, it could be a
MenuManager too. 

Bug410426Test contains two tests which checks the corrected behaviors.

Change-Id: I5fd8b73ab8224fe9bd549549fac5eb0daf1b322f
Signed-off-by: Quintin Stokes xxx@xxx.xxx

COMMENTS

author: Brenden Conley
date: 2014-02-11 16:15:16.000000000

Patch Set 5:

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

-------------------------------------
author: Brenden Conley
date: 2014-02-11 16:27:12.000000000

Patch Set 5: Verified+1

Build Successful 

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

-------------------------------------
author: Slade Moran
date: 2014-02-11 17:28:18.000000000

Patch Set 5: Code-Review-1

Comments inline.

-------------------------------------
author: Lilia Joyce
date: 2014-02-11 20:34:18.000000000

Patch Set 5:

Paul, I do not see your comments.

Regards,

Maxime

-------------------------------------
author: Slade Moran
date: 2014-02-11 20:52:56.000000000

Patch Set 5:

(4 comments)

Sorry, they were against patch set 4.  I've moved them to patch set 5.

Line:10, bundles/org.eclipse.e4.ui.workLeon Ochoach.renderers.swt/src/org/eclipse/e4/ui/workbench/renderers/swt/ToolBarManagerRenderer.java -> Update this same as in the other file.

Line:179, bundles/org.eclipse.e4.ui.workLeon Ochoach.renderers.swt/src/org/eclipse/e4/ui/workbench/renderers/swt/ToolBarManagerRenderer.java -> I would put this part of the if first, since instanceof MenuManager is more specific than ContributionItem.

Line:10, bundles/org.eclipse.e4.ui.workLeon Ochoach.renderers.swt/src/org/eclipse/e4/ui/workbench/renderers/swt/ToolBarContributionRecord.java -> You can put your name here as well:
Your Name xxx@xxx.xxx Obeo - Bug....

Line:152, bundles/org.eclipse.e4.ui.workLeon Ochoach.renderers.swt/src/org/eclipse/e4/ui/workbench/renderers/swt/ToolBarContributionRecord.java -> I think this should be org.eclipse.e4.ui.workbench.renderers.swt.ToolBarContributionRecord.generatedElements where the generated elements will go.  The toolbarModel will contain potentially children from other elements.

-------------------------------------
author: Lilia Joyce
date: 2014-02-12 08:42:55.000000000

Patch Set 5:

(4 comments)

Line:10, bundles/org.eclipse.e4.ui.workLeon Ochoach.renderers.swt/src/org/eclipse/e4/ui/workbench/renderers/swt/ToolBarManagerRenderer.java -> Done

Line:179, bundles/org.eclipse.e4.ui.workLeon Ochoach.renderers.swt/src/org/eclipse/e4/ui/workbench/renderers/swt/ToolBarManagerRenderer.java -> Done

Line:10, bundles/org.eclipse.e4.ui.workLeon Ochoach.renderers.swt/src/org/eclipse/e4/ui/workbench/renderers/swt/ToolBarContributionRecord.java -> Done

Line:152, bundles/org.eclipse.e4.ui.workLeon Ochoach.renderers.swt/src/org/eclipse/e4/ui/workbench/renderers/swt/ToolBarContributionRecord.java -> I put getChildren because in mergeIntoModel() all copyElements are put in the getChildren() list (after mergeFactoryIntoModel() for the factory case).

If I use generatedElements, we will potentially miss some visibleWhen on MToolBarSeparator but these elements are shared and the first separator with id is taken, so visibleWhen on a separator does not make sense.

The next patch set will use org.eclipse.e4.ui.workLeon Ochoach.renderers.swt.ToolBarContributionRecord.generatedElements.

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