> I still wish there were a way to change widget class names There is myButton.setStyleName("foo"); Or myButton.addStyleName("foo");
There's also the concept of primary style names and dependent style names, if you want to dig into that. On Thu, Jul 2, 2009 at 2:00 PM, hobbyist<bindingserv...@gmail.com> wrote: > > On Jul 2, 9:09 am, "alex.d" <alex.dukhov...@googlemail.com> wrote: >> >> Just override .gwt-Button in your MyApp.css and all buttons will have >> your style. >> > > Thanks! This achieves the effect I was aiming for. I still wish > there were a way to change widget class names, but this certainly gets > the job done. Thanks again for the answer; this solution is so simple > that it makes my question sound silly. > > > On Jul 2, 5:29 am, djd <alex.dobjans...@gmail.com> wrote: >> >> AFAIK, styles are set in each class, when they are constructed (so, >> via constructor). >> > > I checked this, and unfortunately it looks like this is true: > http://code.google.com/p/google-web-toolkit/source/browse/branches/snapshot-2009.06.16-r5570/user/src/com/google/gwt/user/client/ui/Button.java#74 > > On line 80 (inside the Button() constructor), you see the string "gwt- > Button" is hard-coded. I assume the same is true in other widgets. > Is there any good reason why GWT widgets class names are initialized > this way, for performance maybe? Without a compelling performance > gain, hard-coding this string just seems like bad practice. > >> Still, what you actually want is some sort of UIDL (User Interface >> Definition Language) parser. There are many proposals, you could >> implement a simple one that only handles stylenames. > > Do you know if there are there any proposals close to completion? I > enjoy writing parsers, but I don't want to write my own if something > new is about to be published. > > > --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---