If you just want to keep your java, css and ui.xml code in different folders, there's an easier technique. Create two folders parallel to src - "uibinder" and "css". Or whatever you want to name it. Then add these folders to the sourcepath in eclipse. These three folders should have the same package hierarchy, so GWT will be able to find ui.xml and css files without any problem.
In our project, the above convention helps us to separate ui code from java code. Keeps the ui folks from stepping over developers toes. --Sri On 11 May 2010 21:23, Yaakov <yaakov.chai...@gmail.com> wrote: > Hi, > > Does anyone know if there is a way to place the ui.xml files in a > separate from its Java counterpart file package? > > What I have to have is essentially the following package structure: > view - All Java uibinder classes > view.uibinder - All .ui.xml files > view.uibinder.resources - All .css files. > > I found the @UiTemplate annotation that allowed me to successfully > move the ui.xml files into the view.uibinder package and just refer to > those in the Java file with @UiTemplate("uibinder/someView.ui.xml"). > > Unfortunately, all the references to the resources, although showing > no errors in Eclipse, start breaking on GWT compile. So, for example, > if I have the following in my ui.xml: > <ui:style field='myStyle' src='resources/style.css' /> > > When compiled, the error says that it can't find the style when lookin > in view/resources/styles.css. Note the lack of "uibinder" directory in > the error message! > > Upon further testing, it seems clear that when the ui.xml files gets > ingested into its Java counter part, it copies that 'src' path > verbatum, without adjusting it first. I know this because if I put "../ > resources/style.css", the error message will come with that it can't > find the path and show that it's looking in "view/../resources/ > style.css" > > Is there some annotation or some flag I am supposed to provide to get > this to work or is the location of the .ui.xml file forever stuck with > the location of its counterpart Java file? > > Thanks, > Yaakov. > > -- > You received this message because you are subscribed to the Google Groups > "Google Web Toolkit" group. > To post to this group, send email to google-web-tool...@googlegroups.com. > To unsubscribe from this group, send email to > google-web-toolkit+unsubscr...@googlegroups.com<google-web-toolkit%2bunsubscr...@googlegroups.com> > . > 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 google-web-tool...@googlegroups.com. To unsubscribe from this group, send email to google-web-toolkit+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/google-web-toolkit?hl=en.