Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Eclipse 4 » e4 plug-in perspective creation
icon5.gif  e4 plug-in perspective creation [message #1063296] Wed, 12 June 2013 22:43 Go to next message
Ozgur Cagdas is currently offline Ozgur CagdasFriend
Messages: 32
Registered: May 2013
Member
Hi,

I have an e4 plug-in and trying to add a perspective to it so I can switch to it after installing it to Eclipse. I added the following perspective extension to the plugin.xml file.

<extension point="org.eclipse.ui.perspectives">
   <perspective
			name="MyPerspective"
			class="com.oz.perspective.MyPerspective"
			id="com.oz.myperspective">
   </perspective>
</extension>


And com.oz.perspective.MyPerspective class implements IPerspectiveFactory. Within my Application.e4xmi file there is already a Perspective Stack -> Perspective defined. So, how can I make the MyPerspective class launch the Perspective defined in the e4xmi file?

As a second question, is there a way to by pass MyPerspective class and directly point at the Perspective within e4xmi from the plugin.xml extension?

Regards,

O.


[Updated on: Fri, 14 June 2013 08:37]

Report message to a moderator

icon5.gif  Re: e4 plug-in perspective creation [message #1063638 is a reply to message #1063296] Thu, 13 June 2013 14:55 Go to previous messageGo to next message
Ozgur Cagdas is currently offline Ozgur CagdasFriend
Messages: 32
Registered: May 2013
Member
Hi again,

I've started with a test plugin (and a feature accompanying it) and adding the org.eclipse.ui dependency avoids the application to be launched by giving below errors.

I've also attached the the sample plugin and feature which is currently broken the way it is. If I remove the mentioned dependency and the org.eclipse.ui.perspectives entry from the plugin.xml, application launches.

So;

1- Is there a way to fix this issue and make the OzTestPerspective activate the Perspective defined under the Application.e4xmi file?

2- Can I bypass implementing the IPerspectiveFactory and 'magically' point at the Perspective within e4xmi as the perspective contribution by this plugin, so the perspective looks identical to what I see when the application is launched on its own?

Errors;
!SESSION 2013-06-13 15:38:11.542 -----------------------------------------------
eclipse.buildId=unknown
java.version=1.7.0_09
java.vendor=Oracle Corporation
BootLoader constants: OS=linux, ARCH=x86_64, WS=gtk, NL=en_GB
Framework arguments:  -product org.oz.test.plugin.product -clearPersistedState
Command-line arguments:  -product org.oz.test.plugin.product -data /home/ocagdas/rcp/../runtime-org.oz.test.plugin.product -dev file:/home/ocagdas/rcp/.metadata/.plugins/org.eclipse.pde.core/org.oz.test.plugin.product/dev.properties -os linux -ws gtk -arch x86_64 -consoleLog -clearPersistedState

!ENTRY org.eclipse.equinox.app 0 0 2013-06-13 15:38:13.085
!MESSAGE Product org.oz.test.plugin.product could not be found.

!ENTRY org.eclipse.osgi 2 0 2013-06-13 15:38:13.212
!MESSAGE One or more bundles are not resolved because the following root constraints are not resolved:
!SUBENTRY 1 org.eclipse.osgi 2 0 2013-06-13 15:38:13.213
!MESSAGE Bundle reference:file:/home/ocagdas/codebase/sysmon_graph/org.oz.test.plugin/ was not resolved.
!SUBENTRY 2 org.oz.test.plugin 2 0 2013-06-13 15:38:13.213
!MESSAGE Missing required bundle org.eclipse.ui_0.0.0.

!ENTRY org.eclipse.osgi 2 0 2013-06-13 15:38:13.215
!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 2013-06-13 15:38:13.216
!MESSAGE Bundle org.oz.test.plugin_1.0.0.qualifier [67] was not resolved.
!SUBENTRY 2 org.oz.test.plugin 2 0 2013-06-13 15:38:13.216
!MESSAGE Missing required bundle org.eclipse.ui_0.0.0.

!ENTRY org.eclipse.osgi 2 0 2013-06-13 15:38:13.243
!MESSAGE One or more bundles are not resolved because the following root constraints are not resolved:
!SUBENTRY 1 org.eclipse.osgi 2 0 2013-06-13 15:38:13.243
!MESSAGE Bundle reference:file:/home/ocagdas/codebase/sysmon_graph/org.oz.test.plugin/ was not resolved.
!SUBENTRY 2 org.oz.test.plugin 2 0 2013-06-13 15:38:13.244
!MESSAGE Missing required bundle org.eclipse.ui_0.0.0.

!ENTRY org.eclipse.osgi 2 0 2013-06-13 15:38:13.246
!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 2013-06-13 15:38:13.246
!MESSAGE Bundle org.oz.test.plugin_1.0.0.qualifier [67] was not resolved.
!SUBENTRY 2 org.oz.test.plugin 2 0 2013-06-13 15:38:13.247
!MESSAGE Missing required bundle org.eclipse.ui_0.0.0.

!ENTRY org.eclipse.osgi 4 0 2013-06-13 15:38:13.248
!MESSAGE Application error
!STACK 1
java.lang.RuntimeException: No application id has been found.
	at org.eclipse.equinox.internal.app.EclipseAppContainer.startDefaultApp(EclipseAppContainer.java:242)
	at org.eclipse.equinox.internal.app.MainApplicationLauncher.run(MainApplicationLauncher.java:29)
	at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:110)
	at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:79)
	at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:353)
	at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:180)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:601)
	at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:629)
	at org.eclipse.equinox.launcher.Main.basicRun(Main.java:584)
	at org.eclipse.equinox.launcher.Main.run(Main.java:1438)
	at org.eclipse.equinox.launcher.Main.main(Main.java:1414)
gogo: CommandNotFoundException: Command not found: gosh
org.apache.felix.gogo.runtime.CommandNotFoundException: Command not found: gosh
	at org.apache.felix.gogo.runtime.Closure.executeCmd(Closure.java:466)
	at org.apache.felix.gogo.runtime.Closure.executeStatement(Closure.java:395)
	at org.apache.felix.gogo.runtime.Pipe.run(Pipe.java:108)
	at org.apache.felix.gogo.runtime.Closure.execute(Closure.java:183)
	at org.apache.felix.gogo.runtime.Closure.execute(Closure.java:120)
	at org.apache.felix.gogo.runtime.CommandSessionImpl.execute(CommandSessionImpl.java:89)
	at org.apache.felix.gogo.shell.Activator.run(Activator.java:75)
	at java.lang.Thread.run(Thread.java:722)
An error has occurred. See the log file
/home/ocagdas/rcp/.metadata/.plugins/org.eclipse.pde.core/org.oz.test.plugin.product/1371134291805.log.


Regards,

O.

[Updated on: Fri, 14 June 2013 08:39]

Report message to a moderator

Re: e4 plug-in perspective creation [message #1063831 is a reply to message #1063296] Fri, 14 June 2013 12:14 Go to previous messageGo to next message
Paul Webster is currently offline Paul WebsterFriend
Messages: 6859
Registered: July 2009
Location: Ottawa
Senior Member

On 06/12/2013 06:43 PM, Ozgur Cagdas wrote:
> Hi,
>
> I have an e4 plug-in and trying to add a perspective to it so I can
> switch to it after installing it to Eclipse. I added the following
> perspective extension to the plugin.xml file.
>
>
> <extension point="org.eclipse.ui.perspectives">
> <perspective
> name="MyPerspective"
> class="com.oz.perspective.MyPerspective"
> id="com.oz.myperspective">
> </perspective>
> </extension>


Perspectives as an extension + IPerspectiveFactory is not supported yet
in an Eclipse4 RCP app. You only have the model.

If you are including org.eclipse.ui, you're not really an Eclipse4
application any more as that's the bulk of the entire 4.x Workbench
layer (supports 3.x APIs). Why wouldn't you just use a 3.x RCP app at
that point.

If you want to stay as an Eclipse4 application, have a look at
org.eclipse.ui.internal.e4.compatibility.ModeledPageLayout. That's the
class in the Workbench that converts perspective factory contributions
into model.

PW


--
Paul Webster
http://wiki.eclipse.org/Platform_Command_Framework
http://wiki.eclipse.org/Command_Core_Expressions
http://wiki.eclipse.org/Platform_Expression_Framework
http://wiki.eclipse.org/Menu_Contributions
http://wiki.eclipse.org/Menus_Extension_Mapping
http://help.eclipse.org/helios/index.jsp?topic=/org.eclipse.platform.doc.isv/guide/workbench.htm


Re: e4 plug-in perspective creation [message #1063847 is a reply to message #1063831] Fri, 14 June 2013 13:19 Go to previous messageGo to next message
Ozgur Cagdas is currently offline Ozgur CagdasFriend
Messages: 32
Registered: May 2013
Member
Thanks for the answer Paul. Not mixing org.eclipse.ui with an e4 app makes sense really.

Even though it's proven to be a pit painful so far, I'm keen on keeping the application pure e4, at least until I hit a brick wall.

I'll study the ModeledPageLayout a bit and try to understand how to use it. However, after an unsuccessful attempt of googling quickly, may I ask if anybody has a sample application in hand that demonstrates how to contribute a perspective pure e4 way? Sorry if I am being too demanding and lazy.

Regards,

O.


Re: e4 plug-in perspective creation [message #1064118 is a reply to message #1063847] Mon, 17 June 2013 17:36 Go to previous message
Eric Moffatt is currently offline Eric MoffattFriend
Messages: 118
Registered: July 2009
Senior Member
Ozgur, to 'add' a perspective the e4 way try this:

1) Find the MPerspectiveStack in your model (there has to be one if you want to use perspectives...)

2) Create a new MPersepective and format it as you desire (You might be able to get some help from the ModeledPageLayout API since all it does is create model elements from the various apis).

3) Add it to the MPerspectiveStack

4) Make it the Stack's selected element (should cause it to render...)
Previous Topic:defining features. Is adding of external features - undesired?
Next Topic:unhandled event loop in juno and kepler
Goto Forum:
  


Current Time: Thu Mar 28 12:53:47 GMT 2024

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

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

Back to the top