Hi Kai,

I have seen problem with SWT Label and to correct the problem you must add
this code :

else if (widget instanceof Control) {
                ((Control) widget).setForeground(newColor);
            }

at end of methode applyCSSPropertyColo of the class
CSSPropertyTextSWTHandler

Here the complete code this method.

public void applyCSSPropertyColor(Object element, CSSValue value,
            String pseudo, CSSEngine engine) throws Exception {
        Widget widget = (Widget) element;
        if (value.getCssValueType() == CSSValue.CSS_PRIMITIVE_VALUE) {
            Color newColor = (Color) engine.convert(value, Color.class,
widget
                    .getDisplay());
            if (widget instanceof CTabItem) {
                CTabFolder folder = ((CTabItem) widget).getParent();
                if ("selected".equals(pseudo)) {
                    folder.setSelectionForeground(newColor);
                } else {
                    folder.setForeground(newColor);
                }
            }
            else if (widget instanceof Control) {
                ((Control) widget).setForeground(newColor);
            }
        }
    }


I would like just say that it should be very good to refactor CSS engine to
manage to :

* 1) Have an SWTElement per SWT Type widget
* 2) SWTElement  should (perhaps) apply/reset styles in order to avoiding
cast Widget into *Handler.
* 3) use extension point or develop OSGi Extender to customize the CSS
engine.

For the point 1 I can done that if you wish. I'm waiting for if you are OK
with that.

Regards Angelo

2010/2/19 Remy Suen <[email protected]>

> Hi Kai,
>
>
> On Fri, Feb 19, 2010 at 3:57 AM, Toedter, Kai <[email protected]>
> wrote:
> > When I started the e4 contacts demo I noticed:
> >
> > - Label css styling does not work anymore
> > - Tabs css styling does not work anymore
> > - Toolbar is not styled correctly
> > - Toolbar has a border that is not styled
> > - Toolbar does not fill the space to the right
>
> I see this on my computer on XP as well. I believe Eric also noticed it on
> his machine.
>
>
> > I would like to help fixing the above topics. Who can I best talk with to
> proceed?
>
> Eric and/or Bogdan would be the best people to approach. Can you file a bug
> about this matter? Do you know if the setForeground(Color) methods are even
> being called? Please feel free to drop by on IRC to speak with us directly.
>
> For the tabs problem, we removed ETabFolder but seems to have forgotten to
> change the CSS files. I have just released changes to the CSS files. Please
> synchronize again to get the changes.
> https://bugs.eclipse.org/bugs/show_bug.cgi?id=301739
>
> Regards,
> Remy
>
> ----------
> Remy Suen
> Eclipse Platform/UI Committer
> IBM Ottawa
> 613-356-5162
>
> _______________________________________________
> e4-dev mailing list
> [email protected]
> https://dev.eclipse.org/mailman/listinfo/e4-dev
>
>
_______________________________________________
e4-dev mailing list
[email protected]
https://dev.eclipse.org/mailman/listinfo/e4-dev

Reply via email to