Yup. I strip out anything that's not alphanumeric, and for each such character, capitalize the next character so you end up with a camel-cased name. This covers the most common cases, where dashes and underscores are used to separate words. Keith
On Wed, Oct 7, 2009 at 11:58 AM, Ray Ryan <[email protected]> wrote: > Do you have similar handling of dashes? > > > On Wed, Oct 7, 2009 at 8:39 AM, Keith Platfoot <[email protected]>wrote: > >> >>> Perhaps I'm wrong to be dismissive of Keith's concerns--we're aiming at >>> different audiences. He's' generating source that people will work with >>> directly, I'm generating source that will only be accessed via attribute >>> settings in a ui.xml file. @Keith, what do you do when you see >>> save_button--do you convert it and provide an annotation to point back to >>> the .css name? >>> >>> >> Exactly. The CSS class save_button would turn into: >> >> @ClassName("save_button") >> String saveButton(); >> >> I'm not sure how common it is to use underscores in CSS files... I did in >> my sample projects, and my GWT code ended up looking like it had a bunch of >> Ruby calls in it (which by convention uses underscores rather than >> camel-casing for method names). So I decided it was worthwhile (at least in >> my case) to try to make the CssResource methods look more like regular Java >> identifiers. >> >> Keith >> >> >> > > --~--~---------~--~----~------------~-------~--~----~ http://groups.google.com/group/Google-Web-Toolkit-Contributors -~----------~----~----~----~------~----~------~--~---
