Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 325148

Summary: EPS should not select an unrendered element when hiding a part
Product: [Eclipse Project] e4 Reporter: Remy Suen <remy.suen>
Component: UIAssignee: Remy Suen <remy.suen>
Status: VERIFIED FIXED QA Contact: Remy Suen <remy.suen>
Severity: normal    
Priority: P3    
Version: 1.0   
Target Milestone: 4.1 M2   
Hardware: PC   
OS: Windows XP   
Whiteboard:
Attachments:
Description Flags
EPartService patch v1 none

Description Remy Suen CLA 2010-09-13 14:05:53 EDT
1. Open a file.
2. Drag a view into the editor stack.
3. Close the view.
4. Close the editor.

java.lang.NullPointerException
	at org.eclipse.e4.ui.workbench.renderers.swt.SWTPartRenderer.setCSSInfo(SWTPartRenderer.java:68)
	at org.eclipse.e4.ui.workbench.renderers.swt.SWTPartRenderer.bindWidget(SWTPartRenderer.java:96)
	at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.createWidget(PartRenderingEngine.java:574)
	at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.createGui(PartRenderingEngine.java:414)
	at org.eclipse.e4.ui.workbench.renderers.swt.StackRenderer.showTab(StackRenderer.java:547)
	at org.eclipse.e4.ui.workbench.renderers.swt.LazyStackRenderer$1.handleEvent(LazyStackRenderer.java:75)
	at org.eclipse.e4.ui.services.internal.events.UIEventHandler.handleEvent(UIEventHandler.java:41)
	at org.eclipse.equinox.internal.event.EventHandlerWrapper.handleEvent(EventHandlerWrapper.java:188)
	at org.eclipse.equinox.internal.event.EventHandlerTracker.dispatchEvent(EventHandlerTracker.java:198)
	at org.eclipse.osgi.framework.eventmgr.EventManager.dispatchEvent(EventManager.java:227)
	at org.eclipse.osgi.framework.eventmgr.ListenerQueue.dispatchEventSynchronous(ListenerQueue.java:149)
	at org.eclipse.equinox.internal.event.EventAdminImpl.dispatchEvent(EventAdminImpl.java:139)
	at org.eclipse.equinox.internal.event.EventAdminImpl.sendEvent(EventAdminImpl.java:78)
	at org.eclipse.equinox.internal.event.EventComponent.sendEvent(EventComponent.java:39)
	at org.eclipse.e4.ui.services.internal.events.EventBroker.send(EventBroker.java:73)
	at org.eclipse.e4.ui.internal.workbench.UIEventPublisher.notifyChanged(UIEventPublisher.java:58)
	at org.eclipse.emf.common.notify.impl.BasicNotifierImpl.eNotify(BasicNotifierImpl.java:380)
	at org.eclipse.e4.ui.model.application.ui.impl.ElementContainerImpl.setSelectedElement(ElementContainerImpl.java:159)
	at org.eclipse.e4.ui.internal.workbench.PartServiceImpl.hidePart(PartServiceImpl.java:734)
	at org.eclipse.ui.internal.WorkbenchPage.hidePart(WorkbenchPage.java:999)
	at org.eclipse.ui.internal.WorkbenchPage.closeEditors(WorkbenchPage.java:899)
	at org.eclipse.ui.internal.WorkbenchPage.closeEditor(WorkbenchPage.java:1055)
	at org.eclipse.ui.internal.CloseEditorHandler.execute(CloseEditorHandler.java:47)
Comment 1 Remy Suen CLA 2010-09-13 14:54:21 EDT
This seems to be because the view's part is still in the stack when the editor is closed. When this happens, the code forcibly tries to set it as the selected element which ends up causing rendering as there seems to be a placeholder inside the shared area. I suspect a fix is needed both for the EPS implementation and the DND code.
Comment 2 Remy Suen CLA 2010-09-15 08:04:27 EDT
Created attachment 178917 [details]
EPartService patch v1
Comment 3 Remy Suen CLA 2010-09-15 08:05:34 EDT
(In reply to comment #2)
> Created an attachment (id=178917) [details]
> EPartService patch v1

Fix released to HEAD.

The DND code may need to be changed but that can come later pending the decisions made in bug 321864.
Comment 4 Remy Suen CLA 2010-09-17 07:43:42 EDT
Verified with I20100916-1954 on Windows XP.