Fix of Revision: ec7b8d0b2c after code review. Added a check condition before remov...
[pithos] / src / gr / ebs / gss / client / LoadingIndicator.java
1 /*\r
2  * Copyright 2007, 2008, 2009, 2010 Electronic Business Systems Ltd.\r
3  *\r
4  * This file is part of GSS.\r
5  *\r
6  * GSS is free software: you can redistribute it and/or modify\r
7  * it under the terms of the GNU General Public License as published by\r
8  * the Free Software Foundation, either version 3 of the License, or\r
9  * (at your option) any later version.\r
10  *\r
11  * GSS is distributed in the hope that it will be useful,\r
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of\r
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\r
14  * GNU General Public License for more details.\r
15  *\r
16  * You should have received a copy of the GNU General Public License\r
17  * along with GSS.  If not, see <http://www.gnu.org/licenses/>.\r
18  */\r
19 package gr.ebs.gss.client;\r
20 \r
21 import com.google.gwt.resources.client.ClientBundle;\r
22 import com.google.gwt.resources.client.ImageResource;\r
23 import com.google.gwt.user.client.ui.AbstractImagePrototype;\r
24 import com.google.gwt.user.client.ui.Composite;\r
25 import com.google.gwt.user.client.ui.HTML;\r
26 \r
27 /**\r
28  * The 'loading' indicator widget implementation.\r
29  */\r
30 public class LoadingIndicator extends Composite {\r
31 \r
32         /**\r
33          * An image bundle for this widgets images.\r
34          */\r
35         public interface Images extends ClientBundle {\r
36                 @Source("gr/ebs/gss/resources/ajax-loader.gif")\r
37                 ImageResource loading();\r
38         }\r
39 \r
40         /**\r
41          * The widget's constructor that creates a spinning indicator image.\r
42          */\r
43         public LoadingIndicator(Images images) {\r
44                 HTML inner = new HTML(AbstractImagePrototype.create(images.loading()).getHTML());\r
45                 initWidget(inner);\r
46         }\r
47 }\r