| Summary: | WorkbenchWindowControlContribution createControl Window called twice | ||||||
|---|---|---|---|---|---|---|---|
| Product: | [Eclipse Project] Platform | Reporter: | Patrick Chuong <pchuong> | ||||
| Component: | UI | Assignee: | Platform-UI-Inbox <Platform-UI-Inbox> | ||||
| Status: | CLOSED WONTFIX | QA Contact: | |||||
| Severity: | normal | ||||||
| Priority: | P3 | CC: | bsd, loskutov | ||||
| Version: | 3.8.2 | ||||||
| Target Milestone: | --- | ||||||
| Hardware: | All | ||||||
| OS: | All | ||||||
| See Also: | https://bugs.eclipse.org/bugs/show_bug.cgi?id=427452 | ||||||
| Whiteboard: | stalebug | ||||||
| Attachments: |
|
||||||
|
Description
Patrick Chuong
I've seen the same on 3.8.2 (sure, stack was different) but the problem was that trim contribution was created twice on startup. Patrick, how do you contribute your controls? Can you share a minimal example? Created attachment 263193 [details]
demo project
Hi Andrey, after spending half a day creating an reproducible example. I finally found the right receipt. Creating the example was easy, but having it to reproduce the issue was some what challenging... I hope you can reproduce it and have a solution for it. I have the attached example imported into my development workspace (neon), launch eclipse using the "Run an application" selected (org.eclipse.ui.ide.workbench). Also have the workspace clear and clear the configuration area before launching checked. It is a combination of the property tester, run as applicatoin, and clearing the workspace/configuration that trigger creating multiple workbenchs. Why aren't you just calling WorkbenchWindowControlContribution#getWorkbenchWindow() from within your createControl()? You should almost never ever need to call PlatformUI.getWorkbench().getActiveWorkbenchWindow(). (In reply to Brian de Alwis from comment #5) > Why aren't you just calling > WorkbenchWindowControlContribution#getWorkbenchWindow() from within your > createControl()? > > You should almost never ever need to call > PlatformUI.getWorkbench().getActiveWorkbenchWindow(). Because WorkbenchWindowControlContribution#getWorkbenchWindow() returns null. I believe it is related to bug 427452. Calling getActiveWorkbenchWindow() shouldn't cause the WorkbenchWindowControlContribution#createControl to be called twice. This bug hasn't had any activity in quite some time. Maybe the problem got resolved, was a duplicate of something else, or became less pressing for some reason - or maybe it's still relevant but just hasn't been looked at yet. As such, we're closing this bug. If you have further information on the current state of the bug, please add it and reopen this bug. The information can be, for example, that the problem still occurs, that you still want the feature, that more information is needed, or that the bug is (for whatever reason) no longer relevant. -- The automated Eclipse Genie. |