This Bugzilla instance is deprecated, and most Eclipse projects now use GitHub or Eclipse GitLab. Please see the deprecation plan for details.
Bug 409834 - [Perspectives] Placeholder with secondary ID is being relocated to false container causing views to show at false location
Summary: [Perspectives] Placeholder with secondary ID is being relocated to false cont...
Status: VERIFIED FIXED
Alias: None
Product: Platform
Classification: Eclipse Project
Component: UI (show other bugs)
Version: 4.3   Edit
Hardware: PC Windows 7
: P3 normal (vote)
Target Milestone: 4.4 M4   Edit
Assignee: Eric Moffatt CLA
QA Contact: Eric Moffatt CLA
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: 422350
  Show dependency tree
 
Reported: 2013-06-04 07:44 EDT by Jens Kuebler CLA
Modified: 2013-12-10 14:06 EST (History)
1 user (show)

See Also:


Attachments
Search exact placeholder before the wildcard placeholder (2.48 KB, patch)
2013-06-04 07:47 EDT, Jens Kuebler CLA
no flags Details | Diff
Improved patch that favors shared area and active perspective (3.20 KB, patch)
2013-08-12 10:40 EDT, Jens Kuebler CLA
no flags Details | Diff
Project that creates false relocation of placeholder. (11.78 KB, application/x-zip)
2013-09-02 06:05 EDT, Jens Kuebler CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Jens Kuebler CLA 2013-06-04 07:44:17 EDT
Suppose you create two placeholders in two different perspectives
a) MyView:* (PerpectiveA)
b) MyView:specialSecondaryId (PerspectiveB)

then PartServiceImpl#addPart(MPart providedPart, MPart localPart) for 
MyView:specialSecondaryId
tries to find the placeholder MyView:* and locates its container.

From the provided part the placeholder is determined which has id
MyView:specialSecondaryId and resides in perspectiveB.

The method however does not care about this placeholder and relocates it to the container of placeholder MyView:*.

The MyView:specialSecondaryId placeholder is thus being moved where it should not.

I suppose a search for the exact placeholder must occur before any wildcard placeholder is being searched.

Reading http://help.eclipse.org/indigo/index.jsp?topic=%2Forg.eclipse.platform.doc.isv%2Freference%2Fapi%2Forg%2Feclipse%2Fui%2FIPageLayout.html
indicates that placeholders with secondaryIds are valid.
Comment 1 Jens Kuebler CLA 2013-06-04 07:47:24 EDT
Created attachment 231930 [details]
Search exact placeholder before the wildcard placeholder
Comment 2 Eric Moffatt CLA 2013-06-06 15:26:55 EDT
Jens, thanks for the patch. We'll take a look for the SR1 release...
Comment 3 Jens Kuebler CLA 2013-06-07 05:36:57 EDT
Thanks for setting a target milestone.
FYI: I discovered that the patch brings up new problems in having multiple views. This is probably related to the adjustPlaceholder call and I will investigate this soon.
Comment 4 Eric Moffatt CLA 2013-06-07 10:48:36 EDT
Beauty, get back with whatever you find...
Comment 5 Jens Kuebler CLA 2013-08-12 10:40:47 EDT
Created attachment 234316 [details]
Improved patch that favors shared area and active perspective
Comment 6 Eric Moffatt CLA 2013-08-26 15:43:50 EDT
Jens, I'm looking at the defect and your patch and think we'd be better off trying a slightly different approach. Your case of the specific secondaryId *should* be able to be treated as if the placeholder was for a view with that id.

What I mean here is that we might do the checks we normally do to find a normal view's placeholder and only if we can't find a location to do the ".*" search.

Is there any way you could attach a small project that I could use to test with ?
Comment 7 Jens Kuebler CLA 2013-08-30 03:24:00 EDT
I will setup some perspectives that should resemble the problematic model state.
Comment 8 Jens Kuebler CLA 2013-09-02 06:05:44 EDT
Created attachment 235071 [details]
Project that creates false relocation of placeholder.
Comment 9 Eric Moffatt CLA 2013-11-05 14:29:32 EST
Jens, I just tried your test project (thanks!!) using 4.4M3 and I get the following results:

In PerspectiveA executing 'FindPlaceholderHandler' results in the view being opened to the left of the EditorArea, in PerspectiveB it shows up below the EA.

To me this seems to indicate that this defect is already fixed, could you check and get back to me. I think that this defect was fixed by the code added for Bug 397612.
Comment 10 Jens Kuebler CLA 2013-11-08 11:59:19 EST
Tried this with 4.3.1 and it is still malfunctioning.

Open Perspective A -> Click Show View
Open Perspective B -> Clock Show View
Two Views are present.
Close one view in Perspective B and both views are closed.
Comment 11 Eric Moffatt CLA 2013-11-18 13:58:14 EST
Jens, I can see the problem now (it also fails in Luna), I working on this one now...
Comment 12 Eric Moffatt CLA 2013-11-22 10:57:10 EST
Committed:

http://git.eclipse.org/c/platform/eclipse.platform.ui.git/commit/?id=eeb3a086b45159d53eb930ccb819bd216f9a66de

This does two things;

- Makes sure that the search for the 'global wildcard' only takes place within the currently active perspective (which was the original cause of the defect)

- Most important is that it also moves the test for the 'global wildcard' into 'addToLastContainer'. This means that we allow the full 'normal' logic to run *before* trying to find a ':*' wildcard. This means that you can have both a specific wildcard "<ViewId>:A" *and* a global one "<ViewId>:*" in the same perspective and it'll do the right thing...
Comment 13 Eric Moffatt CLA 2013-12-10 14:06:07 EST
Verified in 4.4.0.I20131209-2000.