On 23 sep, 08:18, mohan <[email protected]> wrote:
> Hi All,
> As i m new to the GWT, i dont know where to put the images for my
> site.
>
> com.test.gwt.contactus.client is my package structure of my client and
> contactus.java has the following code:
>
> Image jimmyFull = new Image("bold.jpg");
> final PopupPanel imagePopup = new PopupPanel(true);
> imagePopup.setAnimationEnabled(true);
> imagePopup.ensureDebugId("cwBasicPopup-imagePopup");
> imagePopup.setWidget(jimmyFull);
> jimmyFull.addClickHandler(new ClickHandler() {
> public void onClick(ClickEvent event) {
> imagePopup.hide();
> }
>
> });
>
> Basically where can i have the image, so that when i compile it should
> go with my site.
> Kindly guide me.Thanks :)
If you don't use ImageBundle, then either:
- you put them in your package's "public" subfolder (com/test/gwt/
contactus/public) and use new Image(GWT.getModuleBaseURL() +
"bold.jpg");
- or put them in your war/ folder and use new Image
(GWT.getHostPageBaseURL() + "bold.jpg")
You can of course use subfolders...
The advantage of the first approach is if your module is reusable
(<inherit/>ed in another module), you'll always have the images right
(that's how the GWT themes work for example).
The advantage of the second approach is that it's easy to change the
image being used: just change the image in the war/, or even have
multiple war folders each with a different bold.jpg in them. That's
generally how you'd do "themed" versions for, e.g., different clients
(e.g. the client's logo); provided it won't affect the app's layout.
And you wouldn't even have to compile the app for each and every
client: compile it once and just copy the generated code over and over
in your different war/ folders.
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---