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

Bug 94798

Summary: [Perspectives] [ViewMgmt] Showing a view having a matching wildcard placeholder always adds it as the last child
Product: [Eclipse Project] Platform Reporter: Nick Edgar <n.a.edgar>
Component: UIAssignee: Platform UI Triaged <platform-ui-triaged>
Status: CLOSED WONTFIX QA Contact:
Severity: normal    
Priority: P5    
Version: 3.1   
Target Milestone: ---   
Hardware: PC   
OS: Windows 2000   
Whiteboard: stalebug

Description Nick Edgar CLA 2005-05-11 13:41:13 EDT
build I20050509

- Change the browser example's BrowserPerspectiveFactory to have:
	public void createInitialLayout(IPageLayout layout) {
		IFolderLayout folder = layout.createFolder("folder1", IPageLayout.RIGHT, .50f,
IPageLayout.ID_EDITOR_AREA);
		folder.addView(IBrowserConstants.BROWSER_VIEW_ID);
		folder.addPlaceholder(IBrowserConstants.BROWSER_VIEW_ID + ":*");
		folder.addView(IBrowserConstants.HISTORY_VIEW_ID);
		layout.setEditorAreaVisible(false);
	}

- Launch it
- File > New Window to ensure the perspective is opened from scratch
- File > New Tab
- The new browser view appears after the History view.  It should appear where
the placeholder is, between the first browser view and the History view.
Comment 1 Nick Edgar CLA 2005-05-11 13:44:48 EDT
In PerspectiveHelper.addPart, it has the following code to process this case:
                    if (placeholder.hasWildCard()) {
                        if (container instanceof PartSashContainer)
                            ((PartSashContainer) container)
                                    .addChildForPlaceholder(part, placeholder);
                        else
                            container.add(part);
                    } else
                        container.replace(placeholder, part);
                }

In the case of a wildcard placeholder, we don't want to replace the placeholder.
We should insert the new part just before the placeholder, so that repeated
showings appear in order.  But it currently just calls add, which adds it at the
end.
ViewStack.replace has logic to do the relative insertion, but it removes the
placeholder, which we don't want.

To fix this properly would involve adding a new "insertBefore" API to layout
containers, and having it work much like replace but without the removal of the
old part.

Stefan, I wanted to run this by you first, because I know you have thoughts
about how this whole area could be improved.

This is not critical for 3.1.
Comment 2 Stefan Xenos CLA 2005-05-11 14:13:58 EDT
There is a patch waiting in bug 72060 that greatly improves placeholders. I want
to review it before doing any more major changes in this area.
Comment 3 Nick Edgar CLA 2006-03-15 11:46:54 EST
Reassigning bugs in component areas that are changing ownership.
Comment 4 Paul Webster CLA 2006-09-28 15:14:47 EDT
Is this still a problem in 3.3?

PW
Comment 5 Denis Roy CLA 2007-06-22 09:32:56 EDT
Changes requested on bug 193523
Comment 6 Boris Bokowski CLA 2009-11-11 17:32:33 EST
Remy is now responsible for watching the [ViewMgmt] category.
Comment 7 Eclipse Webmaster CLA 2019-09-06 16:16:34 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.

If you have further information on the current state of the bug, please add it. 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.
Comment 8 Eclipse Genie CLA 2022-01-30 19:06:12 EST
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.