Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Eclipse 4 » Adding a status bar to an E4 RCP application
Adding a status bar to an E4 RCP application [message #895221] Thu, 12 July 2012 08:02 Go to next message
Georges Bachelier is currently offline Georges Bachelier
Messages: 26
Registered: May 2010
Junior Member
Hello everybody !

I am converting a starting RCP project to E4 and I am learning a lot about DI, contexts and others topics. I am stopped on the status bar creation and management.

In the Application.e4xmi file, I add a "Window Trim" to Trimbars and I set its Side attribute to Bottom. What should I do now ? Set its Id ? To which value ? Add a ToolControl to the "Window Trim" ?

Thanks a lot in advance for your time !

Georges
Re: Adding a status bar to an E4 RCP application [message #895284 is a reply to message #895221] Thu, 12 July 2012 11:36 Go to previous messageGo to next message
Paul Webster is currently offline Paul Webster
Messages: 6859
Registered: July 2009
Location: Ottawa
Senior Member

If you want to add a status bar, your best bet is to add a ToolControl to the TrimBar. You would provide a class to instantiate your status bar, and we use the class org.eclipse.jface.action.StatusLineManager to actually render the status line in the 4.2 Workbench.

But you would have to figure out how to share that status line amongst all the MParts that need to contribute to it.

PW


Re: Adding a status bar to an E4 RCP application [message #895334 is a reply to message #895284] Thu, 12 July 2012 13:35 Go to previous messageGo to next message
Georges Bachelier is currently offline Georges Bachelier
Messages: 26
Registered: May 2010
Junior Member
Thank you Paul.

> If you want to add a status bar, your best bet is to add a ToolControl to the TrimBar.

Done with the following organization: Trimbars > Window Trim - Bottom > ToolControl


> You would provide a class to instantiate your status bar, and we use the class org.eclipse.jface.action.StatusLineManager to actually render the status line in the 4.2 Workbench.

I use the Class URI field associated with the ToolControl to write a bundleclass://..... declaration.
Could you give me a short example of the bundled class I have to write to instantiate the status bar ? E4 concepts are new for me...

> But you would have to figure out how to share that status line amongst all the MParts that need to contribute to it.

Does this mean there is no standard method to do this ?

Thanks again !

Georges
Re: Adding a status bar to an E4 RCP application [message #895361 is a reply to message #895334] Thu, 12 July 2012 14:59 Go to previous messageGo to next message
Paul Webster is currently offline Paul Webster
Messages: 6859
Registered: July 2009
Location: Ottawa
Senior Member

There is a legacy way that parts report status to the trim within the 4.2 Workbench, but that's all done at the 4.2 Workbench level, not Eclipse4. That's why a pure Eclispe4 app would have to figure out an architecture that works and use that.

In the 4.2 Workbench, we instantiate our status trim using org.eclipse.ui.internal.StandardTrim

PW


Re: Adding a status bar to an E4 RCP application [message #895366 is a reply to message #895361] Thu, 12 July 2012 15:07 Go to previous messageGo to next message
Georges Bachelier is currently offline Georges Bachelier
Messages: 26
Registered: May 2010
Junior Member
Thank you Paul, but that sounds greek to me. Wink

I will come back to this status bar topic when I feel more comfortable with the E4 way of thinking.

Best regards,

Georges
Re: Adding a status bar to an E4 RCP application [message #895424 is a reply to message #895366] Thu, 12 July 2012 20:07 Go to previous messageGo to next message
Sopot Cela is currently offline Sopot Cela
Messages: 597
Registered: December 2010
Senior Member

Use IEventBroker to share the status between MParts. Have the parts publish events and have the status provide a listener to update accordingly.
Re: Adding a status bar to an E4 RCP application [message #895463 is a reply to message #895424] Fri, 13 July 2012 07:01 Go to previous messageGo to next message
Georges Bachelier is currently offline Georges Bachelier
Messages: 26
Registered: May 2010
Junior Member
Thanks a lot for the guide lines!

Georges
Re: Adding a status bar to an E4 RCP application [message #895535 is a reply to message #895463] Fri, 13 July 2012 12:58 Go to previous messageGo to next message
Georges Bachelier is currently offline Georges Bachelier
Messages: 26
Registered: May 2010
Junior Member
I got it working by reading this: http://wiki.eclipse.org/Eclipse4/RCP/Event_Model

Thank you Guys for putting me on tracks. I'm learning a lot!

Best regards,

Georges
Re: Adding a status bar to an E4 RCP application [message #939234 is a reply to message #895221] Wed, 10 October 2012 14:56 Go to previous messageGo to next message
Renso Lohuis is currently offline Renso Lohuis
Messages: 44
Registered: July 2012
Member
Georges, could you post an example of how you got it to work?

I am working on the same thing and a good example could help me a lot.
Re: Adding a status bar to an E4 RCP application [message #941232 is a reply to message #939234] Fri, 12 October 2012 10:17 Go to previous messageGo to next message
Sopot Cela is currently offline Sopot Cela
Messages: 597
Registered: December 2010
Senior Member

Create a window trim bar. Set it to be on botton of the window. Create a tool control with a label or something similar as a status bar. Use IEventBroker to publish&listen for global events and update the label.
Re: Adding a status bar to an E4 RCP application [message #962170 is a reply to message #941232] Sun, 28 October 2012 22:54 Go to previous message
Lars Vogel is currently offline Lars Vogel
Messages: 1049
Registered: July 2009
Senior Member

@Renso: An example for a progress bar which is used as progress monitor can be found here: Eclipse Jobs.
Previous Topic:Re: e4 Eclipse 4 - about dialog
Next Topic:Disabling save of dirty part
Goto Forum:
  


Current Time: Thu Oct 02 10:35:59 GMT 2014

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

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