Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Rich Client Platform (RCP) » How do I use perspective placeholders correctly?
How do I use perspective placeholders correctly? [message #869657] Thu, 03 May 2012 20:01 Go to next message
Nigel Daniels is currently offline Nigel DanielsFriend
Messages: 66
Registered: July 2009
Member
Hi,

I have created a perspective with the following folders:

IFolderLayout topLeftFolder = layout.createFolder("topLeft",
IPageLayout.LEFT, (float) 0.20, editorArea); // $NON-NLS-1$
IFolderLayout bottomLeftFolder = layout.createFolder("bottomLeft",
IPageLayout.BOTTOM, (float) 0.70, "topLeft"); // $NON-NLS-1$
IFolderLayout bottomFolder = layout.createFolder("bottom",
IPageLayout.BOTTOM, (float) 0.70, editorArea); // $NON-NLS-1$

So far I have added views directly but now I have a view I would like
the users to open as and when they need it. I would like this to appear
in the bottomFolder. To enable this I added the following:

bottomFolder.addView(IPageLayout.ID_PROP_SHEET);
bottomFolder.addPlaceholder(ChangeView.ID);

But when I open the view, using a command that calls:

HandlerUtil.getActiveWorkbenchWindow(event).getActivePage().showView(ChangeView.ID);

The view opens across the entire bottom area and disappears as an item
is clicked in the editor. It does not open within the folders
placeholder. I have tried creating a placeholder folder:

IPlaceholderFolderLayout bottomPlaceholderFolder =
layout.createPlaceholderFolder("bottomPlaceholder", IPageLayout.BOTTOM,
(float) 0.70, editorArea); // $NON-NLS-1$

then adding the view using:

bottomPlaceholderFolder.addPlaceholder(ChangeView.ID);

Even doing this has the same result. Is there a step I am missing out or
have I misunderstood how the place holders work in perspectives?

Thanks for any advice,

Nigel
Re: How do I use perspective placeholders correctly? [message #869736 is a reply to message #869657] Fri, 04 May 2012 06:06 Go to previous messageGo to next message
Thorsten Schlathölter is currently offline Thorsten SchlathölterFriend
Messages: 312
Registered: February 2012
Location: Düsseldorf
Senior Member
Hi Nigel,
I also experienced unexpected behaviour when I was working with placeholders. It's some time ago but I remember that it finally turned out that the old position of the View was still stored in my workspace. So make sure you test your stuff in a clean workspace.

Regards
Thorsten
Re: How do I use perspective placeholders correctly? [message #869745 is a reply to message #869736] Fri, 04 May 2012 07:37 Go to previous message
Nigel Daniels is currently offline Nigel DanielsFriend
Messages: 66
Registered: July 2009
Member
Hi Thorsten,

thanks for your advice, this got it working. Even with a -clean the
unexpected behavior persisted but with an entirely new workspace it
works as it should.

Best regards,

Nigel


On 04/05/2012 07:06, Thorsten Schlathölter wrote:
> Hi Nigel,
> I also experienced unexpected behaviour when I was working with
> placeholders. It's some time ago but I remember that it finally turned
> out that the old position of the View was still stored in my workspace.
> So make sure you test your stuff in a clean workspace.
>
> Regards
> Thorsten
Previous Topic:Custom program launcher options?
Next Topic:What's the term for the component that groups editors?
Goto Forum:
  


Current Time: Fri Mar 29 05:59:22 GMT 2024

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

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

Back to the top