How do I use perspective placeholders correctly? [message #869657] |
Thu, 03 May 2012 16:01  |
Eclipse User |
|
|
|
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 #869745 is a reply to message #869736] |
Fri, 04 May 2012 03:37  |
Eclipse User |
|
|
|
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
|
|
|
Powered by
FUDForum. Page generated in 0.22239 seconds