How to show a view in the PlaceHolder automatically? [message #453003] |
Thu, 20 July 2006 05:27 |
Jason 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 |
Ilya Shinkarenko 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 #453327 is a reply to message #453003] |
Wed, 26 July 2006 13:32 |
Jason 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
|
|
|
|
Powered by
FUDForum. Page generated in 0.26495 seconds