Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
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 Go to next message
Marton Sigmond is currently offline Marton SigmondFriend
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 Go to previous messageGo to next message
Marton Sigmond is currently offline Marton SigmondFriend
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
Re: Standalone view placeholder - improper layout? [message #629431 is a reply to message #629427] Tue, 28 September 2010 09:34 Go to previous message
Marton Sigmond is currently offline Marton SigmondFriend
Messages: 73
Registered: July 2009
Location: Hungary
Member
Enhancement request has been sent: https://bugs.eclipse.org/bugs/show_bug.cgi?id=326387

Best Regards,
Marton Sigmond
Senior Software Engineer
Previous Topic:ViewerSorter performance
Next Topic:Bind the editor to a specific filename without an extension
Goto Forum:
  


Current Time: Mon Dec 09 01:23:52 GMT 2024

Powered by FUDForum. Page generated in 0.05775 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top