Skip to main content



      Home
Home » Eclipse Projects » Rich Client Platform (RCP) » [RCP] Laying out a view in the plugin
[RCP] Laying out a view in the plugin [message #467303] Wed, 02 May 2007 11:38 Go to next message
Eclipse UserFriend
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 05:33 Go to previous messageGo to next message
Eclipse UserFriend
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 08:20 Go to previous messageGo to next message
Eclipse UserFriend
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 09:26 Go to previous messageGo to next message
Eclipse UserFriend
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
Re: [RCP] Laying out a view in the plugin [message #467447 is a reply to message #467397] Thu, 03 May 2007 19:36 Go to previous message
Eclipse UserFriend
Hi Emmanuel,

In order to be able to access classes in a plugin from another plugin, under the runtime-tab of the plugin-xml, you could specify which packages could be accessed. And on the calling plugin-xml, you could specify under the dependencies-tab the plugin-name of your plugin having your views.

Hope I could help.
Enrique
Previous Topic:Save Perspective As....Asking To "Paul Keyser"
Next Topic:Activities have no effect
Goto Forum:
  


Current Time: Fri May 16 13:25:37 EDT 2025

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

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

Back to the top