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

Bug 137005

Summary: [Workbench] IWorkbenchPage.isPartVisible(IWorkbenchPart) does not consider page
Product: [Eclipse Project] Platform Reporter: Darin Wright <darin.eclipse>
Component: UIAssignee: Platform UI Triaged <platform-ui-triaged>
Status: CLOSED WONTFIX QA Contact:
Severity: normal    
Priority: P3 CC: loskutov, stefanescu.a
Version: 3.2Keywords: helpwanted
Target Milestone: ---   
Hardware: PC   
OS: Windows XP   
Whiteboard: stalebug

Description Darin Wright CLA 2006-04-17 11:59:55 EDT
The API to test if a part is visible does not consider if the target part is actually in the page aginst which the request is made (from bug 136917). The implementation returns whether the part is visible in whatever page the part resides in.

The console works around the problem by testing the page of the part first.
Comment 1 Paul Webster CLA 2009-09-09 13:15:18 EDT
You would want to see if that part is in the current IWorkbenchPage (not just in its own IWorkbenchPage)?

As it is spec'ed, the method is working but I'm not sure it makes sense to extend it to "this part in this page".  A part will only be in one page.

I would use one of the org.eclipse.ui.IWorkbenchPage.findViewReference(String).  ex: page.findViewReference(getViewSite().getId(), getViewSite().getSecondaryId())

It will return null if the view is not found.

PW
Comment 2 Adrian Stefanescu CLA 2016-03-09 10:22:38 EST
This looks like a big problem.

A view is reported as not visible when the view opened in a perspective then the same view is opened in another perspective. 

If the view is opened in another perspective it's a shared part and the service checks if the MUIElement is part of the current perspective by looking at the getCurSharedRef. That points to another objects included in another perspective and the hole check fails. Antoher type of check is needed in staid of ModelServiceImpl.isHostedElement.

Bottom line: The check looks at the first model_object_instance of the view not the current instance.
Comment 3 Andrey Loskutov CLA 2016-03-09 10:41:08 EST
(In reply to Adrian Stefanescu from comment #2)
> This looks like a big problem.
> 
> A view is reported as not visible when the view opened in a perspective then
> the same view is opened in another perspective. 

Which Eclipse version do you have? There were some changes in 4.6 if I remember correctly - can you check this with the latest 4.6 I-build?
Comment 4 Eclipse Genie CLA 2020-05-27 17:16:41 EDT
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.