GWT is fairly complex - I'm guess the compiler does a lot of optimization
for you and will make that decision for you.  For instance, if you set the
width to a constant, it might decide it's better to have that in a css style
sheet, or as actual javascript manipulating the DOM.

I'm not saying that's whats going on (I haven't looked at the all the
specific optimization techniques the compiler does), but that it's
possible.  From a maintenance point of view though, I think (which means
little given my limited web-dev experience) is that it's better to maintain
your CSS separate.

As for dynamically applying styles, it is called *cascading* style sheets
for a reason.  As far as I know, it's easy to overlay additional CSS to a
page.   This also why some people like to maintain their own stylesheets
within their browser.

On Tue, Mar 10, 2009 at 1:02 AM, Ian Bambury <ianbamb...@gmail.com> wrote:

> My approach is to set in code if it would screw things up if anyone were to
> play about with the settings, and set in style sheets if you would want to
> let people play about with them.
> So if you need a widget in a cell-panel to fill the cell, set it to 100% in
> code, but set the background colour in a style sheet, for example.
>
> You don't want designers messing with stuff which they can only screw up,
> but on the other hand, you don't want to have to recompile and upload
> everything if you are asked to make some heading a bit bigger.
>
> Performance wise, I couldn't tell you, but I've never noticed a difference.
>
> Ian
>
> http://examples.roughian.com
>
>
> 2009/3/10 John H <johntan...@gmail.com>
>
>
>> In general, for better performance. Would you rather
>>
>> public SomePanel extends Panel {
>>
>>    public SomePanel() {
>>        setWidth("100px");
>>        setWidth("100px");
>>        ............
>>    }
>>    ..........
>> }
>>
>> OR
>>
>> panel-style {
>>    width: 100px;
>>    height: 100px;
>> }
>>
>> I tend to try setting every css style attribute during the creation of
>> a panel object just cause I think it's more readable and more flexible
>> to organize code outside of CSS style sheets. But is this a better
>> approach trying to achieve better performance or not or does it really
>> matter?
>>
>>
>>
>
> >
>

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Google Web Toolkit" group.
To post to this group, send email to Google-Web-Toolkit@googlegroups.com
To unsubscribe from this group, send email to 
google-web-toolkit+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/Google-Web-Toolkit?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to