Home » Eclipse Projects » Rich Client Platform (RCP) » Standalone view placeholder - improper layout?(Please let me know if I am doing something wrong or it is a bug.)
Standalone view placeholder - improper layout? [message #629407] |
Tue, 28 September 2010 07:43 |
Marton Sigmond Messages: 73 Registered: July 2009 Location: Hungary |
Member |
|
|
Hi,
to reproduce the problem do the following:
- Generate simple RCP application (Hello RCP template).
- Add 3 views (View1, View2, View3), allowMultiple is set to true for each of them.
- Modify the perspective factory like this:
public void createInitialLayout(final IPageLayout layout) {
layout.setEditorAreaVisible(false);
layout.addStandaloneViewPlaceholder(View1.ID + ":*", IPageLayout.BOTTOM, 0.0f, layout.getEditorArea(), true);
layout.addStandaloneViewPlaceholder(View2.ID + ":*", IPageLayout.BOTTOM, 0.5f, View1.ID, true);
layout.addStandaloneViewPlaceholder(View3.ID + ":*", IPageLayout.RIGHT, 0.5f, View2.ID, true);
} - Override the postWindowOpen() method in the ApplicationWorkbenchWindowAdvisor class:
@Override
public void postWindowOpen() {
final IWorkbenchPage page = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage();
try {
page.showView(View1.ID, "secondaryId1", IWorkbenchPage.VIEW_CREATE);
page.showView(View2.ID, "secondaryId2", IWorkbenchPage.VIEW_CREATE);
page.showView(View3.ID, "secondaryId3", IWorkbenchPage.VIEW_CREATE);
} catch (PartInitException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
} - Run the application.
I expected this:
.-----------.
| View1 |
|-----------|
|View2|View3|
'-----------'
But I got this:
.-----------.
|View3|View2|
|-----------|
| |
| View1 |
| |
'-----------'
Even more interesting that it does not matter whether I put IPageLayout.RIGHT or IPageLayout.LEFT into the third placeholder line, I always get the above layout.
Target platform: 3.6 (20100617-1415)
OS: Ubuntu 10.04
Please let me know whether I misunderstood something or this is a bug.
Thanks,
Marton
Best Regards,
Marton Sigmond
Senior Software Engineer
|
|
|
Re: Standalone view placeholder - improper layout? [message #629427 is a reply to message #629407] |
Tue, 28 September 2010 09:18 |
Marton Sigmond Messages: 73 Registered: July 2009 Location: Hungary |
Member |
|
|
I modified the perspective factory like this:
public void createInitialLayout(final IPageLayout layout) {
layout.setEditorAreaVisible(false);
layout.addStandaloneViewPlaceholder(View1.ID + ":*", IPageLayout.BOTTOM, 0.0f, layout.getEditorArea(), true);
layout.addStandaloneViewPlaceholder(View2.ID + ":*", IPageLayout.BOTTOM, 0.5f, View1.ID + ":*.standalonefolder", true);
layout.addStandaloneViewPlaceholder(View3.ID + ":*", IPageLayout.RIGHT, 0.5f, View2.ID + ":*.standalonefolder", true);
}
Now the layout appears properly.
The drawback of this solution is that the ".standalonefolder" is internal, there is not even a constant defined for it.
The API should be enhanced.
Marton
Best Regards,
Marton Sigmond
Senior Software Engineer
|
|
| |
Goto Forum:
Current Time: Mon Dec 09 01:23:52 GMT 2024
Powered by FUDForum. Page generated in 0.05775 seconds
|