Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Eclipse 4 » Perspective Bar in e4
Perspective Bar in e4 [message #651525] Mon, 31 January 2011 14:46 Go to next message
Christoph  is currently offline Christoph Friend
Messages: 4
Registered: January 2011
Junior Member
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 15:01 Go to previous messageGo to next message
Thomas Schindl is currently offline Thomas SchindlFriend
Messages: 5487
Registered: July 2009
Senior Member
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 15:40 Go to previous messageGo to next message
Christoph  is currently offline Christoph Friend
Messages: 4
Registered: January 2011
Junior Member
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 15:40]

Report message to a moderator

Re: Perspective Bar in e4 [message #651568 is a reply to message #651542] Mon, 31 January 2011 15:55 Go to previous messageGo to next message
Thomas Schindl is currently offline Thomas SchindlFriend
Messages: 5487
Registered: July 2009
Senior Member
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 18:20 Go to previous messageGo to next message
Christoph  is currently offline Christoph Friend
Messages: 4
Registered: January 2011
Junior Member
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 19:55 Go to previous messageGo to next message
Rafael Fogel is currently offline Rafael FogelFriend
Messages: 21
Registered: January 2013
Junior Member
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 21:40 Go to previous messageGo to next message
Jo Jaquinta is currently offline Jo JaquintaFriend
Messages: 40
Registered: January 2013
Location: Boston
Member

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.


~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Jo Grant, Senior Software Engineer
Admin and Config Console Architect
OpenPages, IBM
icon5.gif  Re: Perspective Bar in e4 [message #1227191 is a reply to message #651568] Fri, 03 January 2014 20:18 Go to previous message
Craig Foote is currently offline Craig FooteFriend
Messages: 195
Registered: July 2009
Senior Member
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
Previous Topic:Drag&Drop into an empty MPartStack
Next Topic:Acces items created in XML in widget using RemoteViews
Goto Forum:
  


Current Time: Fri Dec 19 21:04:04 GMT 2014

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

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