Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[e4-dev] Feedback about TK-UI CSS engine

Hi,

At first I would like say a great Thank to Kevin which have integrate TK-UI CSS engine into E4.
Thank a lot Kevin!

I send you mail because I have received some feedback about TK-UI CSS engine and I would like share it with E4.

1. CSS & SWT FormToolKit

A company sent mail to tell me that thea are using TK-UI CSS engine in their RCP application.
They use CSS engine with SWT FormToolkit with very interesting mean I find.

They have extended the FormToolKit to have CSSFormToolkit and apply styles into adpat mehod.
So with this solution :

* No need to loop for SWT widgets hierarchies (it's like the non existing widgetAdded SWT event which have already spoken).
* if I have understood, they are using CSS engine into this SWT Designer, so thay can manage CSS in the same time than UI is designed.
  Is not cool?

I think E4 could implement CSSFormToolKit. What do you think?

2. CSS computed style

They are a big problem  with CSS computed style (see class CSSComputedStyleImpl).
Indead today it manage easy case.

Label {
   color:red;
}


Label[visible='true'] {
   color:green;
}

The second CSS rule is more important than the first CSS rule.

But if you have

Label[visible='true'] {
   color:green;
}


Label[visible='true'][enabled=
'true'] {
   color:green;
}

the CSS rule which is used depends on the order of that CSS rules are written
although the second CSS rule should be more important than the first.

Kevin, I believe that you have change the TK-UI code to use batik SAC selector implementation.
To compute CSS style correctly I believe we must use ExtendedCondition#getSpecificity() and
ExtendedSelector#getSpecificity(); to sort the CSS rules.

So CSS rules must be sorted correctly with getSpecificity.

I think it shoud be very important to have JUnit test about CSS computing.
We could have Mock Object wich implement CSSStylableElement interface and  works with that into the test.

3. UFace

At end I'm not sure  that you have interested with that but I'm working on UFace
and we have implement styles (we are not using TK-UI CSS engine because Tom wish have no dependecies with SAC
to manage it easyly UFace with GWT).

And we have implemented cool stuff like slider where we can set backround-color switch the value of slider.
When you move the slider value, it change the background-color.

I'm using UFace into TK-UI for declarative UI and it's very helpfull (layout properties, widgets properties are observable and it's easy to bind UFace UI and DOM Model)
but it's another subject.

Hope thoses informations could interest E4.

Regards Angelo

Back to the top