Bug 264899 Replace context name with computable debug string
Contexts currently are required to have a name, but this string is only used for debugging purposes. We should instead store this "debug string" in the context itself, allowing clients to use a computed value to add additional debug information. We can make this name optional by supplying a default value, which simplifies life for clients that don't care about the name (much as toString() is optional and a default is provided for those who don't care to implement it).
bundles/org.eclipse.e4.ui.workbench/src/org/eclipse/e4/workbench/ui/renderers/swt/ContributedPartFactory.java
package org.eclipse.e4.workbench.ui.renderers.swt;
import org.eclipse.e4.core.services.IContributionFactory;
import org.eclipse.e4.core.services.context.EclipseContextFactory;
import org.eclipse.e4.core.services.context.IEclipseContext;
import org.eclipse.e4.core.services.context.spi.ContextInjectionFactory;
import org.eclipse.e4.ui.model.application.MContributedPart;
import org.eclipse.e4.ui.model.application.MPart;
import org.eclipse.e4.ui.services.IServiceConstants;
import org.eclipse.e4.workbench.ui.IHandlerService;
import org.eclipse.e4.workbench.ui.internal.UIContextScheduler;
import org.eclipse.swt.SWT;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Event;
import org.eclipse.swt.widgets.Listener;
import org.eclipse.swt.widgets.Widget;
public class ContributedPartFactory extends SWTPartFactory {
	private IContributionFactory contributionFactory;
	public ContributedPartFactory() {
		super();
	}
	public void setContributionFactory(IContributionFactory contributionFactory) {
		this.contributionFactory = contributionFactory;
	}
	public Object createWidget(final MPart<?> part) {
		Widget parentWidget = getParentWidget(part);
		IEclipseContext parentContext = getContextForParent(part);
		Widget newWidget = null;