Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Rich Client Platform (RCP) » How to show a view in the PlaceHolder automatically?
How to show a view in the PlaceHolder automatically? [message #453003] Thu, 20 July 2006 05:27 Go to next message
Jason is currently offline JasonFriend
Messages: 45
Registered: July 2009
Member
Hi there,

There is a PlaceHolder in one perspective in my RCP plugin; the code
snippet looks like:

IFolderLayout browserFolder = layout.createFolder("browserFolder",
IPageLayout.RIGHT, 0.20f,IPageLayout.ID_EDITOR_AREA);
browserFolder.addPlaceholder(CMConstants.ID_BROWSERVIEW + ":*");

So I can activiate(by clicking some buttons) multiple BrowserView in the
folder somewhere else by:
PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActi vePage()
.showView(viewId, secondaryId, mode);

Question: Is it possible to show one view in this folder at the very
begining of opening the perspective? Meaning by default the perspective is
shown, there is a view in the place holder.

I can add the showView method in WorkbenchWindowAdvisor.postWindowCreate()
or postWindowOpen() to make it work; but the truth is that my RCP plugin
is not a standalone application and does not access WorkbenchWindowAdvisor.

But I know there is something I missed, so can someone point me the right
direction to get it work in my plugin?

Thanks in advance,
Jason
Re: How to show a view in the PlaceHolder automatically? [message #453022 is a reply to message #453003] Thu, 20 July 2006 08:05 Go to previous messageGo to next message
Ilya Shinkarenko is currently offline Ilya ShinkarenkoFriend
Messages: 56
Registered: July 2009
Member
use org.eclipse.ui.perspectiveExtension extension point

Jason wrote:
> Hi there,
>
> There is a PlaceHolder in one perspective in my RCP plugin; the code
> snippet looks like:
>
> IFolderLayout browserFolder = layout.createFolder("browserFolder",
> IPageLayout.RIGHT, 0.20f,IPageLayout.ID_EDITOR_AREA);
> browserFolder.addPlaceholder(CMConstants.ID_BROWSERVIEW + ":*");
>
> So I can activiate(by clicking some buttons) multiple BrowserView in the
> folder somewhere else by:
> PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActi vePage()
> .showView(viewId, secondaryId, mode);
>
> Question: Is it possible to show one view in this folder at the very
> begining of opening the perspective? Meaning by default the perspective
> is shown, there is a view in the place holder.
>
> I can add the showView method in
> WorkbenchWindowAdvisor.postWindowCreate() or postWindowOpen() to make it
> work; but the truth is that my RCP plugin is not a standalone
> application and does not access WorkbenchWindowAdvisor.
>
> But I know there is something I missed, so can someone point me the
> right direction to get it work in my plugin?
>
> Thanks in advance,
> Jason
>


Ilya Shinkarenko
--
www.imedic.de
www.rcp-training.com
Re: How to show a view in the PlaceHolder automatically? [message #453054 is a reply to message #453022] Thu, 20 July 2006 15:54 Go to previous messageGo to next message
Jason is currently offline JasonFriend
Messages: 45
Registered: July 2009
Member
Ilya Shinkarenko wrote:

> use org.eclipse.ui.perspectiveExtension extension point

Thank you, this is what I want.


> Ilya Shinkarenko
Re: How to show a view in the PlaceHolder automatically? [message #453327 is a reply to message #453003] Wed, 26 July 2006 13:32 Go to previous messageGo to next message
Jason is currently offline JasonFriend
Messages: 45
Registered: July 2009
Member
Hi all,
Using perspectiveExtensions works in RCP 3.1.2 as following:
<extension
point="org.eclipse.ui.perspectiveExtensions">
<perspectiveExtension targetID="test.perspective.perspective">
<view
closeable="true"
id="test.perspective.view2"
moveable="true"
ratio="0.5"
relationship="stack"
relative="browserFolder"
standalone="false"
visible="true"/>
</perspectiveExtension>
</extension>
After the application starts up, I can see there is a default
view(test.perspective.view2) in the placeholder.
But I'm not able to add another multiple test.perspective.view2 in that
placeholder by IWorkbenchPage.showView(viewId, secondaryId, mode); no view
is added in that folder and there is no exception.

Then I looked into the default view initiated by perspectiveExtensions and
found the secondaryId for the view is Null.

It just looks like perspectiveExtensions and IWorkbenchPage.showView() can
not work together.

Any idea about this?

************************************************************ ****
Another problem I found when I was digging around is perspectiveExtensions
works differently in RCP3.1.2 and RCP3.2.
The following code snippet does not work (view is not added in the folder,
but beside it) for perspectiveExtensions:
IFolderLayout browserFolder = layout.createFolder("browserFolder",
IPageLayout.RIGHT, 0.20f,IPageLayout.ID_EDITOR_AREA);

We should use:
IPlaceholderFolderLayout fl =
layout.createPlaceholderFolder("browserFolder",
IPageLayout.RIGHT, 0.20f,IPageLayout.ID_EDITOR_AREA);

Looks like IFolderLayout just extends IPlaceholderFolderLayout.
I do not know why.

Thank you,
Jason


Jason wrote:

> Hi there,

> There is a PlaceHolder in one perspective in my RCP plugin; the code
> snippet looks like:

> IFolderLayout browserFolder = layout.createFolder("browserFolder",
> IPageLayout.RIGHT, 0.20f,IPageLayout.ID_EDITOR_AREA);
> browserFolder.addPlaceholder(CMConstants.ID_BROWSERVIEW + ":*");

> So I can activiate(by clicking some buttons) multiple BrowserView in the
> folder somewhere else by:
> PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActi vePage()
> .showView(viewId, secondaryId, mode);

> Question: Is it possible to show one view in this folder at the very
> begining of opening the perspective? Meaning by default the perspective is
> shown, there is a view in the place holder.

> I can add the showView method in WorkbenchWindowAdvisor.postWindowCreate()
> or postWindowOpen() to make it work; but the truth is that my RCP plugin
> is not a standalone application and does not access WorkbenchWindowAdvisor.

> But I know there is something I missed, so can someone point me the right
> direction to get it work in my plugin?

> Thanks in advance,
> Jason
Re: How to show a view in the PlaceHolder automatically? [message #453371 is a reply to message #453327] Thu, 27 July 2006 18:38 Go to previous message
Paul Webster is currently offline Paul WebsterFriend
Messages: 6859
Registered: July 2009
Location: Ottawa
Senior Member

Some thoughts:

In the perspectiveExtension extension (haha) you can only stack a view
on a view ... not on a folder.

Also, when creating a placeholder for multi-instance views, I've seen it
down using "id:*" ...

Later,
PW


Previous Topic:Shell window opening on supplying args
Next Topic:Wizard's button label
Goto Forum:
  


Current Time: Sat Dec 21 15:06:38 GMT 2024

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

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

Back to the top