DESCRIPTION

Bug 477670 - Configuration toolbar via popup menu

This adds extensibility to the Toolbar, using the workLeon Ochoach model
fragments.
And a first consumer of this is a popup menu item on toolbar to allows
to show the Configure Persspective dialog.

Change-Id: I030ac85b11c523909fc7c735a184e2c378dee0e1
Signed-off-by: Isis Velasquez xxx@xxx.xxx


COMMENTS

author: Isis Velasquez
date: 2015-11-12 13:02:53.000000000

Uploaded patch set 3.

-------------------------------------
author: Brenden Conley
date: 2015-11-12 13:02:59.000000000

Patch Set 3:

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

-------------------------------------
author: Brenden Conley
date: 2015-11-12 13:39:01.000000000

Patch Set 3: Verified+1

Build Successful 

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

-------------------------------------
author: Jayvion Booth
date: 2015-11-17 20:04:18.000000000

Patch Set 3: Code-Review-1

(1 comment)

I could not get it working from inside the debugger. It looks like no addons with "popup:toolbar" are found. Any idea how to get it working?

Also I was only able to properly debug the code after un-obfuscating it from streams and lambdas.

Line:255, bundles/org.eclipse.e4.ui.workLeon Ochoach.renderers.swt/src/org/eclipse/e4/ui/workbench/renderers/swt/ToolControlRenderer.java -> Sorry, the code uses all the nice additions to the Java 8 but because of this it is not debuggable anymore.

The snippet below does exact same and allows debugging:

for (MMenuContribution menuModel : application.getMenuContributions()) {
	String positionInParent = menuModel.getPositionInParent();
	if (positionInParent.startsWith("popup:toolbar")) { //$NON-NLS-1$
		for (MMenuElement itemModel : menuModel.getChildren()) {
			if (itemModel instanceof MItem) {
				final IEclipseContext lclContext = getContext(itemModel);
				HandledContributionItem itemRenderer = ContextInjectionFactory
						.make(HandledContributionItem.class, lclContext);
				itemRenderer.setModel((MItem) itemModel);
				itemRenderer.fill(toolControlMenu, 0);
			}
		}
	}
}

-------------------------------------
author: Isis Velasquez
date: 2015-11-18 07:04:16.000000000

Patch Set 3:

Thanks for the review Andrey.
I'll resubmit this patch without streams then, using the snippet you provided.
About testing it, I believe it requires to start a clean workspace, and to make sure org.eclipse.ui.workLeon Ochoach with the change in LegacyIDE is part of the runtime.

-------------------------------------
author: Jayvion Booth
date: 2015-11-18 07:12:22.000000000

Patch Set 3:

> Thanks for the review Andrey.
 > I'll resubmit this patch without streams then, using the snippet
 > you provided.

Thanks!

 > About testing it, I believe it requires to start a clean workspace,

Yesterday I've even used a new workspace with no luck.

 > and to make sure org.eclipse.ui.workLeon Ochoach with the change in
 > LegacyIDE is part of the runtime.

That mean the org.eclipse.ui.workLeon Ochoach project is in the developer workspace - it was.

I will retry this evening.

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