Build fix: moved where GWT.getModuleBaseURL() is called to accomodate use from the Showcase generator.

Review by: rdayal, jlabanca (TBR)


git-svn-id: https://google-web-toolkit.googlecode.com/svn/releases/1.6@4600 8db76d5a-ed1c-0410-87a9-c151d255dfc7
diff --git a/samples/showcase/src/com/google/gwt/sample/showcase/client/ContentWidget.java b/samples/showcase/src/com/google/gwt/sample/showcase/client/ContentWidget.java
index 4f97aaf..0995248 100644
--- a/samples/showcase/src/com/google/gwt/sample/showcase/client/ContentWidget.java
+++ b/samples/showcase/src/com/google/gwt/sample/showcase/client/ContentWidget.java
@@ -15,6 +15,7 @@
  */
 package com.google.gwt.sample.showcase.client;
 
+import com.google.gwt.core.client.GWT;
 import com.google.gwt.event.logical.shared.SelectionEvent;
 import com.google.gwt.event.logical.shared.SelectionHandler;
 import com.google.gwt.http.client.Request;
@@ -292,7 +293,7 @@
       vPanel.add(widget);
     }
     onInitializeComplete();
-    
+
     return deckPanel;
   }
 
@@ -309,7 +310,7 @@
   /**
    * Load the contents of a remote file into the specified widget.
    * 
-   * @param url the URL of the file relative to the source directory in public
+   * @param url a partial path relative to the module base URL
    * @param target the target Widget to place the contents
    * @param callback the callback when the call completes
    */
@@ -317,14 +318,16 @@
       final RequestCallback callback) {
     // Show the loading image
     if (loadingImage == null) {
-      loadingImage = "<img src=\"images/loading.gif\">";
+      loadingImage = "<img src=\"" + GWT.getModuleBaseURL()
+          + "images/loading.gif\">";
     }
     target.setDirection(HasDirection.Direction.LTR);
     DOM.setStyleAttribute(target.getElement(), "textAlign", "left");
     target.setHTML("&nbsp;&nbsp;" + loadingImage);
 
     // Request the contents of the file
-    RequestBuilder builder = new RequestBuilder(RequestBuilder.GET, url);
+    RequestBuilder builder = new RequestBuilder(RequestBuilder.GET,
+        GWT.getModuleBaseURL() + url);
     RequestCallback realCallback = new RequestCallback() {
       public void onError(Request request, Throwable exception) {
         target.setHTML("Cannot find resource");
diff --git a/samples/showcase/src/com/google/gwt/sample/showcase/client/ShowcaseConstants.java b/samples/showcase/src/com/google/gwt/sample/showcase/client/ShowcaseConstants.java
index 8a4f96c..68f59ec 100644
--- a/samples/showcase/src/com/google/gwt/sample/showcase/client/ShowcaseConstants.java
+++ b/samples/showcase/src/com/google/gwt/sample/showcase/client/ShowcaseConstants.java
@@ -15,7 +15,6 @@
  */
 package com.google.gwt.sample.showcase.client;
 
-import com.google.gwt.core.client.GWT;
 import com.google.gwt.i18n.client.Constants;
 import com.google.gwt.sample.showcase.client.content.i18n.CwConstantsExample;
 import com.google.gwt.sample.showcase.client.content.i18n.CwConstantsWithLookupExample;
@@ -80,7 +79,7 @@
   /**
    * The path to source code for examples, raw files, and style definitions.
    */
-  String DST_SOURCE = GWT.getModuleBaseURL() + "gwtShowcaseSource/";
+  String DST_SOURCE = "gwtShowcaseSource/";
 
   /**
    * The destination folder for parsed source code from Showcase examples.