Bug 422238 - [WorkbenchParts][IViewReference] hideView does not work when the perspective is changed
Summary: [WorkbenchParts][IViewReference] hideView does not work when the perspective ...
Status: RESOLVED WORKSFORME
Alias: None
Product: Platform
Classification: Eclipse Project
Component: UI (show other bugs)
Version: 4.2.2   Edit
Hardware: PC Windows 7
: P3 major with 2 votes (vote)
Target Milestone: ---   Edit
Assignee: Platform UI Triaged CLA
QA Contact:
URL:
Whiteboard:
Keywords: needinfo
Depends on:
Blocks:
 
Reported: 2013-11-21 06:10 EST by Shyamala Gowri CLA
Modified: 2016-04-21 06:14 EDT (History)
5 users (show)

See Also:


Attachments
DemoPlugin demonstrating the issue here. (22.79 KB, application/zip)
2013-12-04 10:30 EST, Subin Shekhar CLA
no flags Details
Information on demo plugin and instructions for reproducing the issue. (1.20 KB, text/plain)
2013-12-05 05:35 EST, Subin Shekhar CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Shyamala Gowri CLA 2013-11-21 06:10:17 EST
Attempting to hide a view by invoking hideView() in the current perspective works and in the debug mode i could see that legacyPart variable in the ViewReference object is set to null after hideView() is called. Whereas when the perspective is switched the same code hideView() does not work and the view is not getting closed, the debug mode shows that legacyPart variable in the ViewReference object is not set to null and it still contains the view details. This shows that ViewReference object loses control when the perspective is changed.
Comment 1 Curtis Windatt CLA 2013-11-21 09:55:04 EST
Moving to Platform UI
Comment 2 Jayatheerthan Krishnamurthy CLA 2013-11-22 01:10:10 EST
This bug impacts views with secondary ids. Such views do not get refreshed since the call to hideView() did not execute as expected and the old view is displayed again, after a refresh.

Would be glad to know any work around that I can implement to overcome this bug.

Thanks,
Jay
Comment 3 Jayatheerthan Krishnamurthy CLA 2013-11-27 03:53:30 EST
Could someone respond to my comment 2, with workarounds if any? Pls treat this as urgent.
Comment 4 Paul Webster CLA 2013-11-27 15:26:23 EST
(In reply to Jayatheerthan Krishnamurthy from comment #3)
> Could someone respond to my comment 2, with workarounds if any? Pls treat
> this as urgent.

Please attach a demo plugin that provides 2 perspectives that can show the problem.

PW
Comment 5 Subin Shekhar CLA 2013-12-04 10:30:25 EST
Created attachment 238020 [details]
DemoPlugin demonstrating the issue here.

Uploading a demo plugin as requested. Instructions inside the zip file.
Comment 6 Subin Shekhar CLA 2013-12-05 05:35:33 EST
Created attachment 238059 [details]
Information on demo plugin and instructions for reproducing the issue.
Comment 7 Subin Shekhar CLA 2013-12-17 05:24:09 EST
Any updates?
Comment 8 Subin Shekhar CLA 2014-01-06 01:45:22 EST
So are there any workarounds/alternatives for avoiding this issue?
Comment 9 Wojciech Sudol CLA 2014-09-11 06:43:30 EDT
I reproduced the behaviour described in the Readme.txt file using the attached plug-in, but I am not sure what the problem is.
The plug-in works in the same way in Eclipse 3.7.2, 4.2.2 and 4.4 and it seems to work as expected.
When the DemoPerspective2 is active (and Subviews are not open in it), the SampleView.showSubview(*) method is not called after pressing the 'Recreate Sample View' button, because the IWorkbenchPage.findViewReference(*) and IWorkbenchPage.getViewReferences() methods return views only from active perspective.
Also, I think there is a bug in the attached plugin. In the SampleView.showSubview() method there is "final IViewReference prevView = wbPage.findViewReference(viewId, label);". I believe it should be wbPage.findViewReference(viewId) or wbPage.findViewReference(Subview.ID, label).

What behaviour do you expect?
Comment 10 Wojciech Sudol CLA 2014-10-22 11:04:07 EDT
As mentioned in comment 9, I don't think it is a bug. Removing from 4.5 plan until more information is provided.