Try using a ClientBundle with 
ImageResource<https://developers.google.com/web-toolkit/doc/latest/DevGuideClientBundle#ImageResource>in
 the Common project. This will make it very easy to reference that bundle 
and all of its resources, so that you don't have to worry about relative 
file paths when trying to pull images out of it.

I like to have a resources package in a given widget's package. So you'd 
have the following structure:
com.yourCommonStuff.yourModule.client.widgets.yourWidget.resources 
(ClientBundle interfaces here)
com.yourCommonStuff.yourModule.client.widgets.yourWidget.resources.images 
(image files here)
com.yourCommonStuff.yourModule.client.widgets.yourWidget.resources.css ( 
css files here )
com.yourCommonStuff.yourModule.client.widgets.yourWidget (other widget 
stuff here)

This way everything for a widget is nice and self contained, rather than a 
bunch of widgets dumping all their CSS and images into a single public/ 
folder. It makes referencing files far easier, otherwise you end up with 
lines like @Source('../../../someOtherPkg/public/images/image.png').

Sincerely,
Joseph

On Thursday, May 31, 2012 10:36:17 AM UTC-4, July wrote:
>
>
> My project depends on the other project, i call it "common" because it 
> contain some common widgets, some of these widget use UIbinder, i use 
> something like below in the Uibinder:
>
> <ui:image field='gwtLogo' src="gwtLogo.png" />
>
> the common project is build as jar to be used in upper project, when upper 
> GWT project compile, it can not find the  <ui:image defined as above and 
> give compile error.
>
> Anybody know how to solve this problem? Or any other ways to conquer this?
>
>  thanks in advance.
>
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Google Web Toolkit" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/google-web-toolkit/-/YWuuVHuBAr0J.
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