On 13 jan, 15:54, "[email protected]" <[email protected]> wrote: > Hi all, > > maybe this question is stupid and has a very simple answer, but I > could not find it. > I create a Gwt client module, and In particular I create Widget > subclasses > containing objects from my personal library, > which in turn are built using third party libraries. > > While building I get the error: > > No source code is available for type xxxx...... > > The questions are: > > 1) If I do NOT have the source code for class xxxx, what should I > do?
Not use it. Eventually, you can include a dummy *.java file in a "super-source" in your project, so that the GWT compiler will think it is translatable (using some specialized mapping; that's how the Java Runtime Emulation is done in GWT), and the class will later be pruned on the optimization phase of the compile. > 2) for my own classes (of which obviously I have the source code) > , could somebody point me to an example of how to add it to the > gwt.xml config file? That's not a gwt.xml thing, it's a classpath thing. The *.java files have to be on your classpath. Common practice is to include them in the same JAR that contains the complied *.class (see the gwt-user.jar content). > 3) I understand that the java code is translated to javascript, but > isn't this limited to just the code realizing the page elements? > i.e. if a Java object is contained in the client modules, do all his > methods > have to be translated and all the methods of all the classes that it > references, > even if they are NEVER used for rendering the page? That's how the GWT compiler has been written: it first parse all the code into AST and then optimize the AST before producing the JavaScript. There has been a proposal for a @NotTranslatable annotation that you could put on some methods so they are ignored by the GWT compiler, but I can't remember whether it's been implemented (and in which upcoming version). This means libraries have to explicitly "opt-in" as being usable with GWT (with limited functionnality). --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
