Community
Participate
Working Groups
After migrating from 3.8.2 to 4.7, one of our UI tests ran into this. It was no longer able to close the Debug View, after closing the Debug View (if open) in the current perspective, and switching to the Debug Perspective. The test uses an IViewReference to close the view, which fails. Using an IViewPart instead seems to work as expected. Steps to reproduce: 1. Open a perspective with one folder, the folder contains two views. 2. Retrieve an IViewReference to the inactive view of the perspective. 3. Call IWorkbenchPage.hideView(IViewReference) to close the view. 4. Observe that the view is not closed. Its reference can also still be retrieved via IWorkbenchPage.findViewReference(String).
New Gerrit change created: https://git.eclipse.org/r/106007
Opened a gerrit review with a test case that reproduces the problem.
In PartServiceImpl#hidePart, is it really an else to set the Part toRendered to false? if (toBeRemoved != null) { toBeRemoved.setToBeRendered(false); } else { part.setToBeRendered(false); }
Hi Karsten, sorry for the late reply. About the bug, we observed the problem while closing the Debug View programmatically. If I change my test to add a part listener, I only see the following callbacks: partOpened org.eclipse.ui.internal.ViewReference@7343d843 partVisible org.eclipse.ui.internal.ViewReference@7343d843 partBroughtToTop org.eclipse.ui.internal.ViewReference@7343d843 partActivated org.eclipse.ui.internal.ViewReference@7343d843 partVisible org.eclipse.ui.internal.ViewReference@7343d843 There is nothing about hiding the view. Only its placeholder is actually hidden after calling the hide view reference API. In our test, we want to check whether a feature works despite closing the Debug View. As it stands, we show the Debug View before hiding it in the test, to ensure its actually closed. In the test from the gerrit review, this amounts to adding activePage.showView(INACTIVE_VIEW_ID) before the activatePage.hideView call. Showing the view before hiding it results in the following callbacks: partOpened org.eclipse.ui.internal.ViewReference@6e349258 partVisible org.eclipse.ui.internal.ViewReference@6e349258 partBroughtToTop org.eclipse.ui.internal.ViewReference@6e349258 partActivated org.eclipse.ui.internal.ViewReference@6e349258 partVisible org.eclipse.ui.internal.ViewReference@6e349258 partDeactivated org.eclipse.ui.internal.ViewReference@6e349258 partHidden org.eclipse.ui.internal.ViewReference@6e349258 partOpened org.eclipse.ui.internal.ViewReference@58b30e3e partVisible org.eclipse.ui.internal.ViewReference@58b30e3e partBroughtToTop org.eclipse.ui.internal.ViewReference@58b30e3e partActivated org.eclipse.ui.internal.ViewReference@58b30e3e partHidden org.eclipse.ui.internal.ViewReference@58b30e3e partVisible org.eclipse.ui.internal.ViewReference@6e349258 partBroughtToTop org.eclipse.ui.internal.ViewReference@6e349258 partDeactivated org.eclipse.ui.internal.ViewReference@58b30e3e partActivated org.eclipse.ui.internal.ViewReference@6e349258 partHidden org.eclipse.ui.internal.ViewReference@58b30e3e partClosed org.eclipse.ui.internal.ViewReference@58b30e3e With the change you propose, the test does pass, however the call backs are still: partOpened org.eclipse.ui.internal.ViewReference@7343d843 partVisible org.eclipse.ui.internal.ViewReference@7343d843 partBroughtToTop org.eclipse.ui.internal.ViewReference@7343d843 partActivated org.eclipse.ui.internal.ViewReference@7343d843 partVisible org.eclipse.ui.internal.ViewReference@7343d843 I'm guessing our test is too naive in its validation that the view is actually closed. I'll adapt the gerrit change to include an actual part listener in the test. I'll try to do so this week, but I may take longer to get to it. Best regards, Simeon
Thanks Simeon for taking care of it. I'll have another look when you are ready.
Alright, I updated the patch to use a part listener. Thanks for the help!
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.
Still there