On Thu, Sep 17, 2009 at 9:21 AM, Ray Ryan <[email protected]> wrote: > > > On Wed, Sep 16, 2009 at 8:52 PM, Amir Kashani <[email protected]>wrote: > >> See issues 4052 and 4053. >> You mean class names defined inline, right? Not supporting these >> identifiers for @external class names could be an issue, since all of GWT's >> class names follow that convention. In other words, fix 4053 but not 4052? >> >> I don't see not making the former work as anything other than a small >> inconvenience. But, not knowing the implementation at all, couldn't a valid >> Java method identifier be generated then annotated with @ClassName? A map >> would need to be maintained to look them up for replacement later. >> Alternatively, if the class name is Java-ified in a predictable fashion >> (remove invalid character, ensure it starts with a letter, etc), then the >> generator and "token replacer" could make the necessary changes on the fly. >> > > @ClassName should work, and it's a bug if it doesn't. I'm thinking about > the other direction, where the input is the CSS and we're generating the > CssResource interface for you. >
That's what I meant. For the generated interface, when illegal names are used, rather than making the method identical to the class name, generate a Java safe method name instead, annotating the new method with @ClassName to refer to the original name. Then, within the UiBinder template, references to the original class name can be mapped to calls to the new method name. > I'm wondering whether its worth the effort to make that tolerate > non-java-legal names. > Again, not knowing the details of the implementation, I'm not sure how much work it'd be. It'd be nice, but like I said, not having it is only a minor inconvenience and won't be an issue at all once a decent error message is in place. > But however it washes out, thanks so much for your feedback! > My pleasure. The awesome work you guys are doing with GWT has made my job so much better, so adopting (really) early and providing some feedback is the least I can do. > >> - Amir >> >> On Wed, Sep 16, 2009 at 8:09 PM, Ray Ryan <[email protected]> wrote: >> >>> Posting these as two items on the issue tracker would be great, thanks. >>> I'm really not sure what to do about class names that aren't legal java >>> identifiers, to tell you the truth. That may be beyond the scope of what >>> it's reasonable to do with a css file meant to be tied to a specific ui.xml >>> file. (Although obviously exploding spectacularly isn't acceptable.) >>> >>> >>> On Wed, Sep 16, 2009 at 8:01 PM, Amir Kashani <[email protected]>wrote: >>> >>>> Ray, >>>> >>>> Not sure if UiBinder and ui:style are far enough along that I should be >>>> putting bugs in the issue tracker or just posting here. If you'd rather me >>>> create bugs, let me know. >>>> >>>> There seems to be issues with handling CSS class names with dashes in >>>> them: >>>> >>>> 1) .my-class-name causes the compiler to explode spectacularly, because >>>> the CssResource interface generator doesn't make them Java safe. Really, >>>> any >>>> non-valid method name needs to be handled with @ClassName, or renamed all >>>> together. >>>> >>>> 2) @external doesn't seem to work in combination with the aforementioned >>>> names: >>>> >>>> <ui:style> >>>> @external gwt-TextBox; >>>> >>>> .form { width: 300px; } >>>> >>>> .form .gwt-TextBox { border: 0; } >>>> >>>> </ui:style> >>>> >>>> That seems to ignore the external declaration and tries to create a >>>> gwt-TextBox() method, again, blowing up spectacularly. Oddly, @external >>>> does >>>> work in other instances. >>>> >>>> - Amir >>>> >>>> >>>> >>> >>> >>> >> >> >> > > > > --~--~---------~--~----~------------~-------~--~----~ http://groups.google.com/group/Google-Web-Toolkit-Contributors -~----------~----~----~----~------~----~------~--~---
