I followed the Eclipse 4 tutorial by Lars Vogel and I am trying to build on that application a bit further. I read the Eclipse Plugins book, but I’m still having a bit of a hard time learning Eclipse RCP.
I added a ToolControl with the following Class URI that I copied from the Live Application Model in the IDE.
bundleclass://org.eclipse.ui.workbench/org.eclipse.e4.ui.workbench.addons.perspectiveswitcher.PerspectiveSwitcher
But after launching the product I get this exception:
!ENTRY org.eclipse.e4.ui.workbench 4 0 2012-02-08 20:30:39.010
!MESSAGE Unable to create class 'org.eclipse.e4.ui.workbench.addons.perspectiveswitcher.PerspectiveSwitcher' from bundle '66'
!STACK 0
org.eclipse.e4.core.di.InjectionException: java.lang.IllegalStateException: Workbench has not been created yet.
I tried upping the start-level of my own plugin so it is higher than that of the org.eclipse.ui.workbench plugin. It did not change anything.
So my question is: Is it possible to use the perspective switcher in my own product? Or do I need to approach this in a completely different way?
The perspective switcher that’s in the addons bundle currently needs the 4.2 Workbench, which means creating a standard 3.x RCP app based on Eclipse 4.2 SDK.
There are plans to decouple the perspective switcher from the Workbench but that probably won’t happen until Eclipse 4.3. If you want to use a perspective switcher in Eclipse 4 it looks like you would have to create your own.