How to display a View defined in another plug-in? [message #460366] |
Wed, 20 December 2006 17:25  |
Eclipse User |
|
|
|
I have a RCP with one Perspective defined. Within this Perspective, I want
to display a View that is defined in another plug-in. I tried calling
layout.addView() using the ID of the View as defined by the plug-in, but
that didn't work. To test, I added the
ContributionItemFactory.VIEWS_SHORTLIST item to a menu on my RCP, and this
when invoked, displayed only the Views(s) defined in my RCP project; none of
the Views from any of the plug-ins came up.
I have ensured that the ID of the View is the same, and that the plug-in
package containing the View is exposed in the plug-in's Exported Packages in
the Runtime Editor. What am I missing?
|
|
|
|
|
Re: How to display a View defined in another plug-in? [message #460554 is a reply to message #460483] |
Thu, 21 December 2006 16:53   |
Eclipse User |
|
|
|
This is a multi-part message in MIME format.
------=_NextPart_000_0094_01C72507.62C49E40
Content-Type: text/plain;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
Here are the steps I followed:
1) In the plug-in containing the view (sessionmanager), I exported the =
package (and all related packages) containing the "LaunchView" view. (In =
a later step, I exported ALL packages in the plugin, just as a =
sanity-test)
2) I double-clicked my RCP plugin.xml, and=20
a) In the Dependencies tab, I added "sessionmanager" as a Required =
Plug-in
b) In the Extensions tab, I added "LaunchView" from the =
sessionmanager plugin as an org.eclipse.ui.views extension.(ID of this =
extension element came from the LaunchView class which is public static =
final)
3) In my RCP Perspective class, I loaded the LaunchView using the public =
LaunchView.ID (same id as specified in the plugin.xml in step (2)).
4) When I run my RCP, I get the following error:
!SESSION 2006-12-21 13:46:27.215 =
-----------------------------------------------
eclipse.buildId=3Dunknown
java.version=3D1.5.0_09
java.vendor=3DSun Microsystems Inc.
BootLoader constants: OS=3Dwin32, ARCH=3Dx86, WS=3Dwin32, NL=3Den_US
Framework arguments: -product com.fnfr.svt.fanfaresvt.product
Command-line arguments: -product com.fnfr.svt.fanfaresvt.product -data =
C:\Clister/../runtime-fanfaresvt.product -dev =
file:C:/Clister/.metadata/.plugins/org.eclipse.pde.core/fanf aresvt.produc=
t/dev.properties -os win32 -ws win32 -arch x86
!ENTRY org.eclipse.core.runtime 2006-12-21 13:46:28.199
!MESSAGE Product com.fnfr.svt.fanfaresvt.product could not be found.
!ENTRY org.eclipse.osgi 4 0 2006-12-21 13:46:28.215
!MESSAGE Application error
!STACK 1
java.lang.RuntimeException: No application id has been found.
at =
org.eclipse.core.internal.runtime.PlatformActivator$1.run(Pl atformActivat=
or.java:56)
at =
org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher .runApplicati=
on(EclipseAppLauncher.java:92)
at =
org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher .start(Eclips=
eAppLauncher.java:68)
at =
org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseS tarter.java:4=
00)
at =
org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseS tarter.java:1=
77)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.eclipse.core.launcher.Main.invokeFramework(Main.java:336 )
at org.eclipse.core.launcher.Main.basicRun(Main.java:280)
at org.eclipse.core.launcher.Main.run(Main.java:977)
at org.eclipse.core.launcher.Main.main(Main.java:952)
!ENTRY org.eclipse.osgi 2 0 2006-12-21 13:46:28.231
!MESSAGE One or more bundles are not resolved because the following root =
constraints are not resolved:
!SUBENTRY 1 org.eclipse.osgi 2 0 2006-12-21 13:46:28.231
!MESSAGE Bundle update@../Clister/plugins/fanfaresvt/ was not resolved.
!SUBENTRY 2 com.fnfr.svt.fanfaresvt 2 0 2006-12-21 13:46:28.231
!MESSAGE Missing required bundle com.fnfr.svt.sessionmanager_0.0.0.
!ENTRY org.eclipse.osgi 2 0 2006-12-21 13:46:28.231
!MESSAGE The following is a complete list of bundles which are not =
resolved, see the prior log entry for the root cause if it exists:
!SUBENTRY 1 org.eclipse.osgi 2 0 2006-12-21 13:46:28.231
!MESSAGE Bundle update@../Clister/plugins/fanfaresvt/ [142] was not =
resolved.
!SUBENTRY 2 com.fnfr.svt.fanfaresvt 2 0 2006-12-21 13:46:28.231
!MESSAGE Missing required bundle com.fnfr.svt.sessionmanager_0.0.0.
"Paul Webster" <pwebster@ca.ibm.com> wrote in message =
news:eme8e6$9oq$1@utils.eclipse.org...
> Ameya Barve wrote:
>> I have a RCP with one Perspective defined. Within this Perspective, I =
want=20
>> to display a View that is defined in another plug-in. I tried calling =
>> layout.addView() using the ID of the View as defined by the plug-in, =
but=20
>> that didn't work. To test, I added the=20
>> ContributionItemFactory.VIEWS_SHORTLIST item to a menu on my RCP, and =
this=20
>> when invoked, displayed only the Views(s) defined in my RCP project; =
none of=20
>> the Views from any of the plug-ins came up.
>=20
> Just using the view ID string is fine. addView(*) should actually=20
> display the view in the perspective somewhere.
>=20
> IPageLayout#addShowViewShortcut(*) would probably add it to that=20
> perspective's view shortlist ... but if you can't see it already in =
your=20
> perspective with addView(*) that probably indicates another problem.
>=20
> Are there any errors in your error log when you show the perspective?
>=20
> Later,
> PW
------=_NextPart_000_0094_01C72507.62C49E40
Content-Type: text/html;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=3DContent-Type content=3D"text/html; =
charset=3Diso-8859-1">
<META content=3D"MSHTML 6.00.2900.3020" name=3DGENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY>
<DIV>
<DIV><FONT face=3DVerdana color=3D#0000ff size=3D2>Here are the steps I=20
followed:</FONT></DIV>
<DIV><FONT face=3DVerdana color=3D#0000ff size=3D2></FONT> </DIV>
<DIV><FONT face=3DVerdana color=3D#0000ff size=3D2>1) In the plug-in =
containing the=20
view (sessionmanager), I exported the package (and all related =
packages)=20
containing the "LaunchView" view. (In a later step, I exported ALL =
packages in=20
the plugin, just as a sanity-test)</FONT></DIV>
<DIV><FONT face=3DVerdana color=3D#0000ff size=3D2></FONT> </DIV>
<DIV><FONT face=3DVerdana color=3D#0000ff size=3D2>2) I =
double-clicked my RCP=20
plugin.xml, and </FONT></DIV>
<DIV><FONT face=3DVerdana color=3D#0000ff size=3D2> a) =
In the=20
Dependencies tab, I added "sessionmanager" as a Required=20
Plug-in</FONT></DIV>
<DIV><FONT face=3DVerdana color=3D#0000ff size=3D2> b) =
In the=20
Extensions tab, I added "LaunchView" from the sessionmanager =
plugin as=20
an org.eclipse.ui.views extension.(ID of this extension element came =
from the=20
LaunchView class which is public static final)</FONT></DIV>
<DIV><FONT face=3DVerdana color=3D#0000ff size=3D2></FONT> </DIV>
<DIV><FONT face=3DVerdana color=3D#0000ff size=3D2>3) In my RCP =
Perspective class, I=20
loaded the LaunchView using the public LaunchView.ID (same id as =
specified in=20
the plugin.xml in step (2)).</FONT></DIV>
<DIV><FONT face=3DVerdana color=3D#0000ff size=3D2></FONT> </DIV>
<DIV><FONT face=3DVerdana color=3D#0000ff size=3D2>4) When I run my RCP, =
I get the=20
following error:</FONT></DIV>
<DIV> </DIV>
<DIV><FONT face=3D"Courier New" size=3D2>!SESSION 2006-12-21 =
13:46:27.215=20
-----------------------------------------------<BR>eclipse.buildId=3Dunkn=
own<BR>java.version=3D1.5.0_09<BR>java.vendor=3DSun=20
Microsystems Inc.<BR>BootLoader constants: OS=3Dwin32, ARCH=3Dx86, =
WS=3Dwin32,=20
NL=3Den_US<BR>Framework arguments: -product=20
com.fnfr.svt.fanfaresvt.product<BR>Command-line arguments: =
-product=20
com.fnfr.svt.fanfaresvt.product -data =
C:\Clister/../runtime-fanfaresvt.product=20
-dev=20
file:C:/Clister/.metadata/.plugins/org.eclipse.pde.core/fanf aresvt.produc=
t/dev.properties=20
-os win32 -ws win32 -arch x86</FONT></DIV>
<DIV><FONT face=3D"Courier New" size=3D2></FONT> </DIV>
<DIV><FONT face=3D"Courier New" size=3D2>!ENTRY org.eclipse.core.runtime =
2006-12-21=20
13:46:28.199<BR>!MESSAGE Product com.fnfr.svt.fanfaresvt.product could =
not be=20
found.</FONT></DIV>
<DIV><FONT face=3D"Courier New" size=3D2></FONT> </DIV>
<DIV><FONT face=3D"Courier New" size=3D2>!ENTRY org.eclipse.osgi 4 0 =
2006-12-21=20
13:46:28.215<BR>!MESSAGE Application error<BR>!STACK=20
1<BR>java.lang.RuntimeException: No application id has been =
found.<BR> at=20
org.eclipse.core.internal.runtime.PlatformActivator$1.run(Pl atformActivat=
or.java:56)<BR> at=20
org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher .runApplicati=
on(EclipseAppLauncher.java:92)<BR> at=20
org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher .start(Eclips=
eAppLauncher.java:68)<BR> at=20
org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseS tarter.java:4=
00)<BR> at=20
org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseS tarter.java:1=
77)<BR> at=20
sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)<BR> at=20
sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)<BR> at=20
sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown =
Source)<BR> at=20
java.lang.reflect.Method.invoke(Unknown Source)<BR> at=20
org.eclipse.core.launcher.Main.invokeFramework(Main.java:336 ) <BR> at=
=20
org.eclipse.core.launcher.Main.basicRun(Main.java:280)<BR> at=20
org.eclipse.core.launcher.Main.run(Main.java:977)<BR> at=20
org.eclipse.core.launcher.Main.main(Main.java:952)</FONT></DIV >
<DIV><FONT face=3D"Courier New" size=3D2></FONT> </DIV>
<DIV><FONT face=3D"Courier New" size=3D2>!ENTRY org.eclipse.osgi 2 0 =
2006-12-21=20
13:46:28.231<BR>!MESSAGE One or more bundles are not resolved because =
the=20
following root constraints are not resolved:<BR>!SUBENTRY 1 =
org.eclipse.osgi 2 0=20
2006-12-21 13:46:28.231<BR>!MESSAGE Bundle </FONT><A=20
href=3D"mailto:update@../Clister/plugins/fanfaresvt/"><FONT =
face=3D"Courier New"=20
size=3D2>update@../Clister/plugins/fanfaresvt/</FONT></A><FONT =
face=3D"Courier New"=20
size=3D2> was not resolved.<BR>!SUBENTRY 2 com.fnfr.svt.fanfaresvt 2 0 =
2006-12-21=20
13:46:28.231<BR>!MESSAGE Missing required bundle=20
com.fnfr.svt.sessionmanager_0.0.0.</FONT></DIV>
<DIV><FONT face=3D"Courier New" size=3D2></FONT> </DIV>
<DIV><FONT face=3D"Courier New" size=3D2>!ENTRY org.eclipse.osgi 2 0 =
2006-12-21=20
13:46:28.231<BR>!MESSAGE The following is a complete list of bundles =
which are=20
not resolved, see the prior log entry for the root cause if it=20
exists:<BR>!SUBENTRY 1 org.eclipse.osgi 2 0 2006-12-21 =
13:46:28.231<BR>!MESSAGE=20
Bundle </FONT><A =
href=3D"mailto:update@../Clister/plugins/fanfaresvt/"><FONT=20
face=3D"Courier New" =
size=3D2>update@../Clister/plugins/fanfaresvt/</FONT></A><FONT=20
face=3D"Courier New" size=3D2> [142] was not resolved.<BR>!SUBENTRY 2=20
com.fnfr.svt.fanfaresvt 2 0 2006-12-21 13:46:28.231<BR>!MESSAGE Missing =
required=20
bundle com.fnfr.svt.sessionmanager_0.0.0.</FONT></DIV></DIV>
<DIV><FONT face=3DArial size=3D2></FONT> </DIV>
<DIV><FONT face=3DArial size=3D2></FONT> </DIV>
<DIV><FONT face=3DArial size=3D2>"Paul Webster" <</FONT><A=20
href=3D"mailto:pwebster@ca.ibm.com"><FONT face=3DArial=20
size=3D2>pwebster@ca.ibm.com</FONT></A><FONT face=3DArial size=3D2>> =
wrote in=20
message </FONT><A href=3D"news:eme8e6$9oq$1@utils.eclipse.org"><FONT =
face=3DArial=20
size=3D2>news:eme8e6$9oq$1@utils.eclipse.org</FONT></A><FONT =
face=3DArial=20
size=3D2>...</FONT></DIV><FONT face=3DArial size=3D2>> Ameya Barve=20
wrote:<BR>>> I have a RCP with one Perspective defined. Within =
this=20
Perspective, I want <BR>>> to display a View that is defined in =
another=20
plug-in. I tried calling <BR>>> layout.addView() using the ID of =
the View=20
as defined by the plug-in, but <BR>>> that didn't work. To test, I =
added=20
the <BR>>> ContributionItemFactory.VIEWS_SHORTLIST item to a menu =
on my=20
RCP, and this <BR>>> when invoked, displayed only the Views(s) =
defined in=20
my RCP project; none of <BR>>> the Views from any of the plug-ins =
came=20
up.<BR>> <BR>> Just using the view ID string is fine. =
addView(*)=20
should actually <BR>> display the view in the perspective =
somewhere.<BR>>=20
<BR>> IPageLayout#addShowViewShortcut(*) would probably add it to =
that=20
<BR>> perspective's view shortlist ... but if you can't see it =
already in=20
your <BR>> perspective with addView(*) that probably indicates =
another=20
problem.<BR>> <BR>> Are there any errors in your error log when =
you show=20
the perspective?<BR>> <BR>> Later,<BR>> PW</FONT></BODY></HTML>
------=_NextPart_000_0094_01C72507.62C49E40--
|
|
|
|
Re: How to display a View defined in another plug-in? [message #460607 is a reply to message #460587] |
Fri, 22 December 2006 13:12  |
Eclipse User |
|
|
|
Yup, that worked! Thx a million!
"Paul Webster" <pwebster@ca.ibm.com> wrote in message
news:emgs4f$uc9$2@utils.eclipse.org...
> you need to add all of your required plugins to your launch config under
> Run>Run...
>
> !ENTRY org.eclipse.osgi 2 0 2006-12-21 13:46:28.231
> !MESSAGE One or more bundles are not resolved because the following root
> constraints are not resolved:
> !SUBENTRY 1 org.eclipse.osgi 2 0 2006-12-21 13:46:28.231
> !MESSAGE Bundle update@../Clister/plugins/fanfaresvt/ was not resolved.
> !SUBENTRY 2 com.fnfr.svt.fanfaresvt 2 0 2006-12-21 13:46:28.231
> !MESSAGE Missing required bundle com.fnfr.svt.sessionmanager_0.0.0.
>
> any time you see Missing .... plugin_0.0.0 it means that you've added a
> required bundle to your plugin but you haven't yet updated your launch
> config with the new plugin.
>
> Later,
> PW
|
|
|
Powered by
FUDForum. Page generated in 0.03274 seconds