The key is that only 'client/' is pulled in automatically. You can specify
additional directories in your module. See:
http://code.google.com/webtoolkit/doc/1.6/DevGuideOrganizingProjects.html#DevGuideModuleXml


   - <source path="*path*" /> : Each occurrence of the <source> tag adds a
   package to the source
path<http://code.google.com/webtoolkit/doc/1.6/DevGuideOrganizingProjects.html#DevGuideModules>
by
   combining the package in which the module XML is found with the specified
   path to a subpackage. Any Java source file appearing in this subpackage or
   any of its subpackages is assumed to be translatable. The <source> element
   supports pattern-based
filtering<http://code.google.com/webtoolkit/doc/1.6/DevGuideOrganizingProjects.html#DevGuidePathFiltering>
to
   allow fine-grained control over which resources get copied into the output
   directory during a GWT compile.


If no <source> element is defined in a module XML file, the *client* subpackage
is implicitly added to the source path as if<source path="client" /> had
been found in the XML. This default helps keep module XML compact for
standard project layouts.


Fred


On Sat, Jun 6, 2009 at 4:55 PM, Mark Renouf <[email protected]> wrote:

>
> Hi sasmas,
>
> GWT needs to be told which paths and source files are
> "translatable" (everything in your source tree is not included by
> default). The most common way of doing this is including a
> Module.gwt.xml somewhere in the source tree below the path you want to
> include, and then specifying "<source path="..."/> in the module
> definition. The module name is the combined list of package names
> leading up the the Module.gwt.xml file + the first part of the
> Module.gwt.xml file.
>
> src/
>   example/
>      test/
>         TestModule.gwt.xml
>         client/
>            MyTestModule.java
>
> If you wanted to make the source in this module available, you'd do as
> above. The module name would be "example.test.TestModule". Within
> "TestModule.gwt.xml" you'd use the line "<source path="client"/
> >" (though "client" is implicitly included by default if found). Now
> when you inherit this module from your main module, the sources will
> be found and used.
>
> com.example.main.MainModule.gwt.xml
>   ...
>   <inherits name="example.test.TestModule"/>
>
> The other option is to use super-source, but it's a bit trickier.You
> can find examples on how this works by searching a bit, it's a little
> complicated to get into here.
>
> On Jun 6, 6:43 pm, samsus <[email protected]> wrote:
> > Hi All,
> >
> > Im trying to use classes from a package inside /src but outside the /
> > src/<project_name>/client folder. Until now i didnt had much sucess, i
> > get the following error: "No source code is available for type
> > test.Test; did you forget to inherit a required module?"
> >
> > This is what i did:
> >
> > created the folder "test" at /src
> >
> > --------------------------------------
> >
> > then the file /src/test/Test.java
> >
> > package test;
> >
> > import com.google.gwt.user.client.Window;
> >
> > public class Test {
> >         public Test() {
> >                 Window.alert("hello");
> >         }
> >
> > }
> >
> > --------------------------------------
> >
> > inside my application i have:
> >
> > import test.Test;
> >
> > (...)
> >
> > public void onModuleLoad() {
> >
> > Test test = new Test();
> >
> > }
> >
> > --------------------------------------
> >
> > Could someone please point me in the right direction? :)
> >
>


-- 
Fred Sauer
[email protected]

[]

--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to