Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Eclipse Scout » How to propagate Eclipse 4 IStylingEngine in Scout
How to propagate Eclipse 4 IStylingEngine in Scout [message #1249579] Tue, 18 February 2014 11:48 Go to next message
Daniel Branco is currently offline Daniel BrancoFriend
Messages: 14
Registered: January 2014
Junior Member
Hello Everyone,

We have a requirement to implement a "ThemeManager". The old product (developed in pure Eclipse 3.x) has its implementation where uses a XML to obtain colors and images.

Now that we are working and migrating to Scout 3.9 which uses e4, we thought in substitute the "ThemeManager" for a CSS style, which is an easy way to work with SWT and RAP (despite the limitations in SWT).

Investigating how e4 works with CSS we found this:

Eclipse4 CSS with Vogella

What we need then in our application is a simple IStylingEngine in order to inject ID and ClassNames to our components, but the problem is that the injection only works if the components are created by e4 and not manually instantiated.

Further investigation made us realise that using ContextInjectionFactory.make to instantiate our components can be used to inject the style, but it can give us some problems, so we think if there is a way to have the IStylingEngine available for example in our SWT Environment or something like that.

My questions are, has anyone used the CSS in Scout SWT? Is there any other way to set ID and ClassNames to our components? If not, Any suggestion to have that @Inject IStylingEngine available "automagically" resolve by e4?

Thanks in advance and Kind regards,
Daniel Branco
Re: How to propagate Eclipse 4 IStylingEngine in Scout [message #1251859 is a reply to message #1249579] Thu, 20 February 2014 17:27 Go to previous messageGo to next message
Jeremie Bresson is currently offline Jeremie BressonFriend
Messages: 1252
Registered: October 2011
Senior Member
For the moment Scout works on top of a Eclipse 4 runtime with help of the compatibility layer.

For Luna release (Scout 4.0) we are not recommending the Eclipse 4 runtime.
https://wiki.eclipse.org/Scout/Release/Luna#Eclipse_Platform

We would appreciate any move in the Eclipse 4 direction, it would definitively make sense. In our opinion, Scout on top of E4 is still experimental.
Re: How to propagate Eclipse 4 IStylingEngine in Scout [message #1251873 is a reply to message #1251859] Thu, 20 February 2014 17:49 Go to previous messageGo to next message
Daniel Branco is currently offline Daniel BrancoFriend
Messages: 14
Registered: January 2014
Junior Member
Hello Jeremie,

We are doing that, so far these are our comments:

1. IStylingEngine is not needed to be used you can assign IDs and Classes to the components using the following label.setData("org.eclipse.e4.ui.css.id", "SeparatorLabel"); check: Eclipsopedia CSS Setting class and ID SWT
2. The CSS is upto now under changes and being tested, the documentation is very poor but with some effort we are doing something. When having a decent CSS I will post it with some comments to be a reference.
3. The CSS even that is in incubation phase has its advantages, we strongly recommend it, I will post what's needed to make it run.
4. The CSS in Kepler do not support import url in order to have a base style and extend, this will become available in eclipse Luna.
5. For some study about this it can be checked Eclipse Chrome Style, this is a plug-in project that using the eclipse 4 and redifining a lot it is capable of customize a lot of colors etc, in our case we took the CSS built from there and try to customize it to our needs.

Kind regards,
Daniel Branco

[Updated on: Thu, 20 February 2014 17:51]

Report message to a moderator

Re: How to propagate Eclipse 4 IStylingEngine in Scout [message #1252475 is a reply to message #1251873] Fri, 21 February 2014 08:57 Go to previous message
Jeremie Bresson is currently offline Jeremie BressonFriend
Messages: 1252
Registered: October 2011
Senior Member
As I said, we appreciate any feedback on Scout over Eclipse 4. Thank you for sharing!

I haven't found time to have a look at your links, but I definitively will.


A simple way to call #setData(String, String) the method on the SWT fields corresponding to the ScoutModel fields is to override #createFormField() in SwtEnvironment:

@Override
public ISwtScoutFormField createFormField(Composite parent, IFormField model) {
  ISwtScoutFormField formField = super.createFormField(parent, model);
  
  //Set something on the field:
  formField.getSwtField().setData("key", "value");

  //Set something on the label:
  formField.getSwtLabel().setData("key", "value");
  return formField;
}


I am not sure it will entirely solve your problem, but I hope it give you a starting point... (do not hesitate to continue the discussion).
Previous Topic:Desktop Extensions - Location of a Menu
Next Topic:How to commit project to CVS and few questions
Goto Forum:
  


Current Time: Thu Apr 25 13:11:00 GMT 2024

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

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

Back to the top