[RCP] Laying out a view in the plugin [message #467303] |
Wed, 02 May 2007 15:38 |
Eclipse User |
|
|
|
Originally posted by: emmanuel.blonvia.vidal.fr
Hi there,
I've developped an eclipse RCP client software. In that main RCP software, I
used an IPerspectiveFactory.createInitialLayout(IPageLayout) to layout all
my views. But now, I'm developping an other (secundary) plugin for my main
RCP software I mentioned above and I want to add some other views via that
plugin.
I don't know how to layout my views. For the moment the only thing I can do
is:
IWorkbenchPage page =
PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActi vePage();
IViewPart viewPart = page.showView("viewid",
"viewId2",IWorkbenchPage.VIEW_ACTIVATE);
But that code always put my view at the same place. How can I master the way
my secundary plugin lays out its views ?
Thanks for your help.
Emmanuel
|
|
|
Re: [RCP] Laying out a view in the plugin [message #467335 is a reply to message #467303] |
Thu, 03 May 2007 09:33 |
eric Messages: 8 Registered: July 2009 |
Junior Member |
|
|
Hi Emmanuel,
I am going from the fact that you created a rcp. Under the Perspective-Class, from the snippet below,
************************
public void createInitialLayout(IPageLayout layout) {
layout.setEditorAreaVisible(false);
layout.addView(View1.ID, IPageLayout.LEFT, 0.50f, layout.getEditorArea());
layout.addView(BelowView1.ID,IPageLayout.BOTTOM, 0.40f, View1.ID);
layout.addView(RightToView1.ID, IPageLayout.RIGHT, 0.25f, layout.getEditorArea());
layout.addView(BelowRithtToView1.ID,IPageLayout.BOTTOM, 0.60f, RightToView1.ID);
}
**************************
I believe your problem will be solved.
Best Regards,
Enique
|
|
|
Re: [RCP] Laying out a view in the plugin [message #467381 is a reply to message #467335] |
Thu, 03 May 2007 12:20 |
Eclipse User |
|
|
|
Originally posted by: emmanuel.blonvia.vidal.fr
Thank you Eric.
I have already similar code source in the perspective my main RCP appli but
the view I want to add comes from a plugin. And in that plugin, I have no
Perspective class. Further more my main RCP appli cannot access the classes
defined in plugins.
So my problem is not resolved : From a plugin, I cannot access the
Perspective.createInitialLayout method of the main rcp plugin.
Thanks to anyone who knows how to solve my problem.
Emmanuel
"eric" <ericyewah@hotmail.com> a
|
|
|
Re: [RCP] Laying out a view in the plugin [message #467397 is a reply to message #467303] |
Thu, 03 May 2007 13:26 |
Patrick Paulin Messages: 44 Registered: July 2009 Location: Madison, Wisconsin |
Member |
|
|
Hi Emmanuel,
Plug-ins can contribute additional views through the
org.eclipse.ui.perspectiveExtensions extension point. You specify the
perspective you want to contribute to, and also the existing view (or the
editor area) that you want your view created in relation to.
--- Patrick
patrick@rcpquickstart.com
Emmanuel BLONVIA wrote:
> Hi there,
> I've developped an eclipse RCP client software. In that main RCP software, I
> used an IPerspectiveFactory.createInitialLayout(IPageLayout) to layout all
> my views. But now, I'm developping an other (secundary) plugin for my main
> RCP software I mentioned above and I want to add some other views via that
> plugin.
> I don't know how to layout my views. For the moment the only thing I can do
> is:
> IWorkbenchPage page =
> PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActi vePage();
> IViewPart viewPart = page.showView("viewid",
> "viewId2",IWorkbenchPage.VIEW_ACTIVATE);
> But that code always put my view at the same place. How can I master the way
> my secundary plugin lays out its views ?
> Thanks for your help.
> Emmanuel
Patrick Paulin
Eclipse RCP/OSGi Trainer and Consultant
Modular Mind, Ltd.
patrick@modumind.com
www.modumind.com
twitter.com/pjpaulin
linkedin.com/in/pjpaulin
|
|
|
|
Powered by
FUDForum. Page generated in 0.02964 seconds