Automated merge with https://gss.googlecode.com/hg/
[pithos] / src / gr / ebs / gss / client / LoadingIndicator.java
index dc69a65..84b6040 100644 (file)
@@ -1,5 +1,5 @@
 /*\r
- * Copyright 2007, 2008, 2009 Electronic Business Systems Ltd.\r
+ * Copyright 2007, 2008, 2009, 2010 Electronic Business Systems Ltd.\r
  *\r
  * This file is part of GSS.\r
  *\r
  */\r
 package gr.ebs.gss.client;\r
 \r
+import com.google.gwt.resources.client.ClientBundle;\r
+import com.google.gwt.resources.client.ImageResource;\r
+import com.google.gwt.user.client.ui.AbstractImagePrototype;\r
+import com.google.gwt.user.client.ui.Composite;\r
 import com.google.gwt.user.client.ui.HTML;\r
-import com.google.gwt.user.client.ui.PopupPanel;\r
 \r
 /**\r
  * The 'loading' indicator widget implementation.\r
  */\r
-public class LoadingIndicator extends PopupPanel {\r
+public class LoadingIndicator extends Composite {\r
 \r
        /**\r
-        * The widget's constructor that creates an inner div that displays the\r
-        * images specified in the stylesheet.\r
+        * An image bundle for this widgets images.\r
         */\r
-       public LoadingIndicator() {\r
-               final HTML inner = new HTML("<div id='loading-area' class='hidden'><p>Loading...</p></div>");\r
-               setWidget(inner);\r
+       public interface Images extends ClientBundle {\r
+               @Source("gr/ebs/gss/resources/ajax-loader.gif")\r
+               ImageResource loading();\r
+       }\r
+\r
+       /**\r
+        * The widget's constructor that creates a spinning indicator image.\r
+        */\r
+       public LoadingIndicator(Images images) {\r
+               HTML inner = new HTML(AbstractImagePrototype.create(images.loading()).getHTML());\r
+               initWidget(inner);\r
        }\r
 }\r