Tom, > I thought about using the GWT Code Generation to get informed whenever > wrapper classes are used but as far as I understood this code > generation only jumps in when I use GWT.create() but this means my > Library users need to use GWT.create(AWrapper.class) instead of "new > AWrapper()" which is not very natural.
If I understand your issue correctly, I think you could make it work by having your AWrapper constructor call GWT.create(AWrapperImpl.class) and delegate all of AWrapper's methods to the AWrapperImpl. That brings generators into the mix without creating a burdensome API. Make sense? - Isaac On Tue, Dec 22, 2009 at 3:17 PM, Tom <[email protected]> wrote: > Hi, > > I've been banging my head against something people here might probably > be able to help me. I've written a wrapper for a extensive JavaScript > Library which itself has a toolchain to optimize JS-Script code by > analyzing the used JS-API. > > As a small example say the js-library has: > * a.js > * b.js > * c.js > > And my wrappers look like this: > -----------8<----------- > AWrapper { > // ... > } > > BWrapper { > // ... > } > > CWrapper { > // ... > } > -----------8<----------- > > Now my problem is that if I want to use it with GWT I need to findout > which Wrapper-Classes the GWT application uses, spit out informations > I can feed into the external toolchain to create an optimized JS- > Library-Version. > > I thought about using the GWT Code Generation to get informed whenever > wrapper classes are used but as far as I understood this code > generation only jumps in when I use GWT.create() but this means my > Library users need to use GWT.create(AWrapper.class) instead of "new > AWrapper()" which is not very natural. > > My ideal thing would be to have annotate my Java-Wrappers with > something like this: > > -----------8<----------- > @JSResource("a.js") > AWrapper { > // ... > } > > @JSResource("b.js") > BWrapper { > // ... > } > > @JSResource("c.js") > CWrapper { > // ... > } > -----------8<----------- > > And somehow plug myself into the GWT-Compiler toolchain and get > informed when ever such a class is visited similar to what would > happen when I use GWT.create(). Does anybody have an idea or a > document, example source I can read though myself? > > -- > > You received this message because you are subscribed to the Google Groups > "Google Web Toolkit" group. > To post to this group, send email to [email protected]. > To unsubscribe from this group, send email to > [email protected]. > For more options, visit this group at > http://groups.google.com/group/google-web-toolkit?hl=en. > > > -- You received this message because you are subscribed to the Google Groups "Google Web Toolkit" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/google-web-toolkit?hl=en.
