Bug 578838

Summary: Multiple IViewPart added to IWorkbenchPage shows only first added
Product: [Eclipse Project] Platform Reporter: Ralph Bosson <rbosson>
Component: UIAssignee: Platform-UI-Inbox <Platform-UI-Inbox>
Status: NEW --- QA Contact:
Severity: normal    
Priority: P3 CC: rolf.theunissen, wim.jongman
Version: 4.21   
Target Milestone: ---   
Hardware: PC   
OS: Mac OS X   
Whiteboard:

Description Ralph Bosson CLA 2022-02-18 12:01:23 EST
Adding multiple IViewParts to a IWorkbenchPage using the path IWorkbench.openWorkbenchWindow(id, null) results in only the first IViewPart being visible. This was not the case in the past. The problem occurs when running an RCP application from with the Eclipse IDE and after building the RCP application.

1.IWorkbench.openWorkbenchWindow(id, null)
2.Where id points to class implementing IPerspectiveFactory
  layout.setEditorAreaVisible(false);
  IFolderLayout folder = layout.createFolder(folder_id, relationship, ratio, editorArea);
  view_id = "the_first_view";
  folder.addView(view_id);
  view_id = "the_second_view";
  folder.addView(view_id);
  ...

When the Perspective/IWorkbenchPage is opened only the "the_first_view" is visible.
The workaround:
Add the following code after the call to IWorkbench.openWorkbenchWindow(id, null).

IWorkbench workbench = PlatformUI.getWorkbench();
			workbench.openWorkbenchWindow(Perspective.pID, null);
IWorkbenchPage page = workbench.getActiveWorkbenchWindow().getActivePage();
for(IViewReference view : page.getViewReferences()) {
	view.getView(true);//forces view visible- I guess
}
Comment 1 Wim Jongman CLA 2022-02-19 06:22:25 EST
(In reply to Ralph Bosson from comment #0)


It will help if you can add a minimal RCP application that demonstrates the problem.
Comment 2 Rolf Theunissen CLA 2022-02-22 05:42:17 EST
(In reply to Ralph Bosson from comment #0)
> This was not the case in the past.

Can you be more specific about the past, i.e., in which version of Eclipse did it work and in which version did it stop working? This will save time for if anybody starts investigating the issue. The more details you provide the higher changes are some things get fixed. Moreover, any patches are more than welcome.
Comment 3 Ralph Bosson CLA 2022-02-22 10:49:51 EST
I have created a quick RCP Application.  It does not produce the same result I get from our full multi-plugin RCP Application. It most likely is what we call around here a path error. Caused by our unique sequence of actions which results in the issue. Thanks for looking at this.