Bug 299435 NPE closing contacts demo with a dirty part
bundles/org.eclipse.e4.ui.workbench.renderers.swt/src/org/eclipse/e4/workbench/ui/renderers/swt/WBWRenderer.java
.getWidth(), wbwModel.getHeight());
		wbwShell.setVisible(element.isVisible());
		wbwShell.setLayout(new FillLayout());
		newWidget = wbwShell;
		bindWidget(element, newWidget);
		
		IEclipseContext localContext = getContext(wbwModel);
		localContext.set(IContextConstants.DEBUG_STRING, "MWindow"); 
		parentContext.set(IContextConstants.ACTIVE_CHILD, localContext);
		
		localContext.set(Shell.class.getName(), wbwShell);
		localContext.set(Workbench.LOCAL_ACTIVE_SHELL, wbwShell);
		if (element instanceof MWindow) {
			TrimmedPartLayout tl = new TrimmedPartLayout(wbwShell);
			wbwShell.setLayout(tl);
		} else {
			wbwShell.setLayout(new FillLayout());
		}
		if (wbwModel.getLabel() != null)
			wbwShell.setText(wbwModel.getLabel());
		String uri = wbwModel.getIconURI();
		if (uri != null) {
			try {
				Image image = ImageDescriptor.createFromURL(new URL(uri))
						.createImage();
				wbwShell.setImage(image);
			} catch (MalformedURLException e) {
				
				if (logger != null)
					logger.error(e);