| Summary: | "IllegalArgumentException: Widget has the wrong parent" if use showPart-Method on unvisible Part | ||||||
|---|---|---|---|---|---|---|---|
| Product: | [Eclipse Project] Platform | Reporter: | Peter Weihrauch <Peter_Weihrauch> | ||||
| Component: | UI | Assignee: | Remy Suen <remy.suen> | ||||
| Status: | VERIFIED FIXED | QA Contact: | Eric Moffatt <emoffatt> | ||||
| Severity: | normal | ||||||
| Priority: | P3 | CC: | dimitar.georgiev, emoffatt, Lars.Vogel, remy.suen, tom.schindl | ||||
| Version: | 4.2 | ||||||
| Target Milestone: | 4.2 M6 | ||||||
| Hardware: | All | ||||||
| OS: | All | ||||||
| Whiteboard: | |||||||
| Attachments: |
|
||||||
Created attachment 210815 [details]
PartRenderingEngineTests patch v1
Eric, this seems to me like a problem in either LazyStackRenderer or StackRenderer. Fix pushed to master. http://git.eclipse.org/c/platform/eclipse.platform.ui.git/commit/?id=feb8869ccc667cf3c69487fa917c6a3b3615f235 Peter, I think what you might want is to have your part start off as toBeRendered="false" and then have it shown later? yes thats right *** Bug 372211 has been marked as a duplicate of this bug. *** Verified by source code inspection with I20120312-1730. |
Build Identifier: I20120127-1145 I have a Part, declared as unvisible, in the aplication model file "application.e4xmi" in the part i declare an Selectionlistner per DI. Example: @Inject public void setTodo(@Optional @Named(IServiceConstants.ACTIVE_SELECTION) Todo obj { ... } if i use the showPart(...)-Method from the EPartService, to set the unvisible part visible, the part will not show ui elements. next i fire a selection event which is targeted to the listener in the part i got the following Error Stacktrace. java.lang.IllegalArgumentException: Widget has the wrong parent at org.eclipse.swt.SWT.error(SWT.java:4281) at org.eclipse.swt.SWT.error(SWT.java:4215) at org.eclipse.swt.SWT.error(SWT.java:4186) at org.eclipse.e4.ui.widgets.CTabItem.setControl(CTabItem.java:284) at org.eclipse.e4.ui.workbench.renderers.swt.StackRenderer.createTab(StackRenderer.java:574) at org.eclipse.e4.ui.workbench.renderers.swt.StackRenderer.childRendered(StackRenderer.java:624) at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.safeCreateGui(PartRenderingEngine.java:640) at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.safeCreateGui(PartRenderingEngine.java:718) at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.access$2(PartRenderingEngine.java:689) at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$7.run(PartRenderingEngine.java:683) at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42) at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.createGui(PartRenderingEngine.java:668) at org.eclipse.e4.ui.workbench.renderers.swt.StackRenderer.showTab(StackRenderer.java:803) at org.eclipse.e4.ui.workbench.renderers.swt.LazyStackRenderer$1.handleEvent(LazyStackRenderer.java:66) at org.eclipse.e4.ui.services.internal.events.UIEventHandler$1.run(UIEventHandler.java:41) workaround is, to use the Method setVisible(...) at the Part-object to set the isVisible flag in the Model just before i call showPart(...). Example: MPart part = pService.findPart(...); if (part != null ) { part.setVisible(true); pService.showPart(part, PartState.VISIBLE); } with the setVisible(...) Method everything works fine. Reproducible: Always Steps to Reproduce: 1. create a unvisible Part in the Model 2. create a class for the Part with a selectionlistener (for example active selection) per DI 3. make the part visible in a SelectionAdapter implementation of a button for example (the gui of the part shouldn't display) 4. fire a selectionevent to test the selectionlistener. 5. the error occurs if the event is fired.