I have many classes in GWT that represents graphical widgets. They are packaged as a GWT module called GWT-Toolbox. This module only have for now, client code. That means, all those classes are mainly layouts, windows, that I reuse along my others GWT-apps (separate modules).
For the moment, the way I’m doing this is that all my others GWT-apps inherits this GWT-Toolbox module.
Is it the right way of doing it ?
My main question is about images resources. I want to use in the GWT-Toolbox module, some images that would be shared along all GWT-apps.
What can I achieve that ? I don’t want to use ClientBundle because it do not fit my needs.
Where do I put my resources files, and how they will be packaged in the GWT-apps ?
For the record, I’m using GWT 2.4
EDIT
So, with the help of the community, I figured out how to proceed. Note, that this solution doesn’t use ClientBundle.
GWT-Toolbox – this is the files structure
-src/main/java
— com.mypackage.toolbox
—— public
——— images
———— img1.png
———— img2.png
——— GWT-Toolbox.gwt.xml
Inside GWT-Toolbox source code, refer to this images like this :
GWT.getModuleBaseURL() + "images/img1.png"
and that’s it.
Absolutely; this is actually no different from widgets the live in the
com.google.gwt.user.Usermodule.(provided inherits means
<inherits/>, and putting the GWT-Toolbox JAR in the classpath)You can either put them as simple resources in your JAR so that other modules can use them with
ClientBundleby providing their path in@Source.Or you an put them in a
publicsubfolder (to be exact, the public path of your module, the subfolder name defaults topublicbut is actually configurable) of your module so they’re deployed side-by-side with the*.cache.*compiled files (this is how themes work in GWT).