[
Date Prev][
Date Next][
Thread Prev][
Thread Next][
Date Index][
Thread Index]
[
List Home]
Re: [e4-dev] CSS to SWT mapping
|
Hi Sven,
At first you write
Text {
background : #FF0000;
}
and not
Text {
back-ground : #FF0000;
}
but I understand your idea. When I have started to create CSS engine I have though about your idea, but i have decided to to follow W3C CSS, because :
* W3C CSS is knowed by a lot of WEB developer.
* you can download style sheet into Internet and apply it to your SWT widgets (if you use HTML mappings).
* originally CSS engine can works with any renderkit (SWT, Swing....) and you can write the same CSS stylesheet for different renderkit.
backround CSS property is a composite CSS properties and you can put several backround-* information (backround-color, backround-image...) into the background CSS property.
For tooling, I agree with you, I would like refactor (I must see with the resposable of E4 CSS engine before) to have PropertySource to use it for instance into Eclipse Property Sheet View.
Regards Angelo
2009/11/23 Sven Efftinge
<sven.efftinge@xxxxxxxxx>
Hi,
I just had a look at the CSS part in e4 and came across the mapping between CSS and SWT (http://wiki.eclipse.org/E4/CSS/SWT_Mapping).
I'd like to suggest to remove that indirection. If we instead had a general function to map between CSS properties and the corresponding setters in the widgets (e.g. foo <-> setFoo) , it would be much easier for users to see what's configurable, just by looking at the widget class. Also the properties would become available from the CSS-language as soon as I introduce a setter method.
In addition we could implement tooling providing content assist, compile checks, navigation and rename refactoring.
This would basically result in writing :
"""
import org.eclipse.swt.widgets.*
Text {
background : #FF0000; //because it's Text.setBackground(Color)
}
"""
instead of :
"""
Text {
back-ground : #FF0000;
}
"""
What do you think?
Cheers,
Sven
_______________________________________________
e4-dev mailing list
e4-dev@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/e4-dev