Bug 573537 - PartServiceImpl.isPartOrPlaceholderInPerspective(String, MPerspective) only works if part and placeholder have the same id
Summary: PartServiceImpl.isPartOrPlaceholderInPerspective(String, MPerspective) only w...
Status: RESOLVED FIXED
Alias: None
Product: Platform
Classification: Eclipse Project
Component: UI (show other bugs)
Version: 4.20   Edit
Hardware: PC Linux
: P3 normal (vote)
Target Milestone: 4.22 M2   Edit
Assignee: Platform-UI-Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2021-05-14 05:50 EDT by Christoph Laeubrich CLA
Modified: 2021-10-19 03:57 EDT (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Christoph Laeubrich CLA 2021-05-14 05:50:03 EDT
calling PartService.isPartOrPlaceholderInPerspective(String, MPerspective) only works if the placeholder and the part have the same id.
Comment 1 Christoph Laeubrich CLA 2021-05-14 06:03:32 EDT
I think instead of searching for placeholders it might be mere suitable of calling

part.getCurSharedRef()

to get the placeholder to check with?
Comment 2 Rolf Theunissen CLA 2021-05-14 08:15:49 EDT
(In reply to Christoph Laeubrich from comment #1)
> I think instead of searching for placeholders it might be mere suitable of
> calling
> 
> part.getCurSharedRef()
> 
> to get the placeholder to check with?

I agree that searching for the placeholders with the same id is not the desired behavior, because then the you require the same ids. (It is advised to use the same ids, but that is also broken see Bug 562472).

However, just taking the getCurSharedRef is not going to work:
1. The current ref might point to a different perspective then searching in.
2. The current ref might not be visible, but another placeholder in the same perspective is.

So all placeholders in the current perspective that point to the part should be visited. Probably, easiest to do that is to find all placeholders in the perspective and check if its pointing to the part.

Could you provide a Gerrit for this?
Comment 3 Eclipse Genie CLA 2021-05-14 09:45:05 EDT
New Gerrit change created: https://git.eclipse.org/r/c/platform/eclipse.platform.ui/+/180607