Skip to main content

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

Hi Tom,

>Now to the right forum :-(

Sorry Tom for my mistake.

>I don't think the FormToolKit-API is needed once we have a real styling
>story. The nice looking API could IMHO better created nested
>SWT-Composite, ...

>Say for example we want to build a form with a title. I'd envision we do
>it like this:

--------8<--------
>Composite form = new Composite(parent,SWT.NONE);
>form.setBackgroundMode(SWT.INHERIT_DEFAULT);
>form.setData("class","form");
>form.setLayout(new GridLayout());

>Composite header = new Composite(form,SWT.NONE);
>header.setBackgroundMode(SWT.INHERIT_DEFAULT);
>header.setData("class","form_header");
>header.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
>header.setLayout(new GridLayout(2,false));

>Label headerImage = new Label(header,SWT.NONE);

>Label headerText = new Label(header,SWT.NONE);
>headerText.setData("form_header_text");

>Composite body = new Composite(form,SWT.NONE);
>body.setData("class","form_body");
>body.setLayoutData(new GridData(GridData.FILL_BOTH));

// .... your standard code
--------8<--------

Sorry Tom, I don't understand your explanation.

I think today the problem with TK-UI CSS engine is that
CSSEngine#applyStyles must be done at end of the build of UI.
applyStyles loop for each SWT widgets hierarchy and apply style for
each widget.

With the SWT Form Toolkit, adapt method is called when SWT widgets is added
to a Composite (I believe it do like this). So no need to loop for SWT
widgets hierarchy,
style is applyed on adapat method (when widgets is added).

If we have SWT widgetAdded event, problem will be resolved, but I
think it's difficult for SWT Team to manage that (I believe Kevin said
that).

Regards Angelo


Back to the top