Skip to main content



      Home
Home » Eclipse Projects » Eclipse 4 » Perspective Bar in e4
Perspective Bar in e4 [message #651525] Mon, 31 January 2011 09:46 Go to next message
Eclipse UserFriend
Hi,

I am currently trying to evaluate the e4 application framework and try to build a small sample app. I successfully worked through the tutorials of Tom Schindl and Lars Vogel, now I want to dig a bit deeper.

One question that bothers me at the moment is: How can I make my e4 app display a perspective bar similar to the one I know from Eclipse 3? I could not find any option in my e4xmi file, nor did I find anything about this on the web.

Any help is appreciated!

Thanks in advance.

Christoph

Maybe, as a siednote: Is there any recommended further documentation that helps me getting a better understanding of e4?
Re: Perspective Bar in e4 [message #651531 is a reply to message #651525] Mon, 31 January 2011 10:01 Go to previous messageGo to next message
Eclipse UserFriend
Hi,

The current perspective switcher is implemented using a ToolControl and
then the real work is done by an addon found in
org.eclipse.e4.ui.workbench.addons.perspectiveswitcher.Persp ectiveSwitcher.

The bad thing about this implementation is that it currently depends on
3.x API so you can't use it in native Eclipse 4.0 applications see bug
335733.

Tom

Am 31.01.11 15:46, schrieb Christoph:
> Hi,
>
> I am currently trying to evaluate the e4 application framework and try
> to build a small sample app. I successfully worked through the tutorials
> of Tom Schindl and Lars Vogel, now I want to dig a bit deeper.
> One question that bothers me at the moment is: How can I make my e4 app
> display a perspective bar similar to the one I know from Eclipse 3? I
> could not find any option in my e4xmi file, nor did I find anything
> about this on the web.
>
> Any help is appreciated!
>
> Thanks in advance.
>
> Christoph
>
> Maybe, as a siednote: Is there any recommended further documentation
> that helps me getting a better understanding of e4?
Re: Perspective Bar in e4 [message #651542 is a reply to message #651525] Mon, 31 January 2011 10:40 Go to previous messageGo to next message
Eclipse UserFriend
Thanks, for the hint, Tom. But I still have trouble adding this to my app.

I just added a ToolControl with the URI

platform:/plugin/org.eclipse.e4.ui.workbench.addons.swt/org. eclipse.e4.ui.workbench.addons.perspectiveswitcher.Perspecti veSwitcher

to my e4xmi file. The switcher is now partly visible but it has no Perspectives attached to ist and I keep getting this exception:

ERROR: Unable to create class 'org.eclipse.e4.ui.workbench.addons.perspectiveswitcher.Pers pectiveSwitcher' from bundle '60'
org.eclipse.e4.core.di.InjectionException: java.lang.IllegalStateException: Workbench has not been created yet.
.
.
.


What am I still missing?

[Updated on: Mon, 31 January 2011 10:40] by Moderator

Re: Perspective Bar in e4 [message #651568 is a reply to message #651542] Mon, 31 January 2011 10:55 Go to previous messageGo to next message
Eclipse UserFriend
Hi,

As mentionned before you can only use this addon when you are running in
Compat-Mode! This is not working in an application written on top of the
vanilla Eclipse 4.0 Application Platform.

So you need to port the code found in there to NOT dependend on 3.x API
but solely working on the 4.0 ApplicationModel (i didn't yet had time to
dig into the code there).

Maybe we can do this as part of fixing #335733 but I can't promise but
if you want you can give it a shot and if you have a working
implementation post it to bug 335733.

Tom

Am 31.01.11 16:40, schrieb Christoph:
> Thanks, for the hint, Tom. But I still have trouble addming this to my app.
>
> I just added a ToolControl with the URI
> platform:/plugin/org.eclipse.e4.ui.workbench.addons.swt/org.
> eclipse.e4.ui.workbench.addons.perspectiveswitcher.Perspecti veSwitcher
>
> to my e4xmi file. The switcher is now partly visible but it has no
> Perspectives attached to ist and I keep getting this exception:
>
> ERROR: Unable to create class
> 'org.eclipse.e4.ui.workbench.addons.perspectiveswitcher.Pers
> pectiveSwitcher' from bundle '60'
> org.eclipse.e4.core.di.InjectionException:
> java.lang.IllegalStateException: Workbench has not been created yet.
Re: Perspective Bar in e4 [message #651589 is a reply to message #651568] Mon, 31 January 2011 13:20 Go to previous messageGo to next message
Eclipse UserFriend
From what I read op to now, I thought, that the compat layer was always loaded in e4 applications, at least if the necessary packages are loaded by the app. What would I do to activate the compat mode? This would be enough for me for now.

Christoph
Re: Perspective Bar in e4 [message #1009826 is a reply to message #651589] Fri, 15 February 2013 14:55 Go to previous messageGo to next message
Eclipse UserFriend
I would like to know this too. Someone can help?
Did it myself [message #1009856 is a reply to message #651525] Fri, 15 February 2013 16:40 Go to previous messageGo to next message
Eclipse UserFriend
I didn't know there was a built in one, so I wrote my own one! My UI designer is going to want a specific look and feel anyway, so I knew I was going to have to do my own implementation.
I then just stuck it in my toolbar as a ToolControl.
It currently doesn't updated if there are dynamic updates to the model, or update selection if something else changes the current perspective. But that shouldn't be too hard to do by just listening to the model.
icon5.gif  Re: Perspective Bar in e4 [message #1227191 is a reply to message #651568] Fri, 03 January 2014 15:18 Go to previous messageGo to next message
Eclipse UserFriend
Hi Tom, I see that bug 335733 is marked fixed in 4.1 but that, in 4.3.1, the addon is still in the org.eclipse.ui.workbench plugin (albeit in an e4 package). Am I correct in thinking that I still cannot use it in a pure e4 application?

Craig
Re: Perspective Bar in e4 [message #1690640 is a reply to message #1227191] Mon, 30 March 2015 06:28 Go to previous message
Eclipse UserFriend
Hi, So I have a perspective switcher but I don't know how to add a perspective to it. The application is developed in Eclipse 3 and I am using The compat layer to add a new perspective developed in Eclipse 4. (Luna Eclipse 4.4) did anyone had the answer to that ?

Inès
Previous Topic:Cannot Get Access to the Main ToolBar
Next Topic:Eclipse warns about deprecated methods
Goto Forum:
  


Current Time: Tue Jul 22 14:28:59 EDT 2025

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

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

Back to the top