import gr.ebs.gss.client.animation.FadeOut;\r
\r
import com.google.gwt.core.client.GWT;\r
+import com.google.gwt.event.dom.client.ClickEvent;\r
+import com.google.gwt.event.dom.client.ClickHandler;\r
+import com.google.gwt.resources.client.ClientBundle;\r
+import com.google.gwt.resources.client.ImageResource;\r
import com.google.gwt.user.client.DOM;\r
import com.google.gwt.user.client.ui.AbstractImagePrototype;\r
-import com.google.gwt.user.client.ui.ClickListener;\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.HasHorizontalAlignment;\r
import com.google.gwt.user.client.ui.HasVerticalAlignment;\r
import com.google.gwt.user.client.ui.HorizontalPanel;\r
-import com.google.gwt.user.client.ui.ImageBundle;\r
import com.google.gwt.user.client.ui.SimplePanel;\r
-import com.google.gwt.user.client.ui.Widget;\r
\r
/**\r
* A panel that displays various system messages.\r
/**\r
* An image bundle for this widget's images.\r
*/\r
- public interface Images extends ImageBundle {\r
- @Resource("gr/ebs/gss/resources/messagebox_info.png")\r
- AbstractImagePrototype info();\r
+ public interface Images extends ClientBundle {\r
+ @Source("gr/ebs/gss/resources/messagebox_info.png")\r
+ ImageResource info();\r
\r
- @Resource("gr/ebs/gss/resources/messagebox_warning.png")\r
- AbstractImagePrototype warn();\r
+ @Source("gr/ebs/gss/resources/messagebox_warning.png")\r
+ ImageResource warn();\r
\r
- @Resource("gr/ebs/gss/resources/messagebox_critical.png")\r
- AbstractImagePrototype error();\r
+ @Source("gr/ebs/gss/resources/messagebox_critical.png")\r
+ ImageResource error();\r
}\r
\r
/**\r
* The widget's images.\r
*/\r
- private Images images;\r
+ public static Images images;\r
\r
/**\r
* The system message to be displayed.\r
inner.add(message);\r
inner.add(clearMessageLink);\r
inner.setCellVerticalAlignment(message, HasVerticalAlignment.ALIGN_MIDDLE);\r
+ clearMessageLink.addClickHandler(new ClickHandler() {\r
\r
- clearMessageLink.addClickListener(new ClickListener() {\r
-\r
- public void onClick(final Widget sender) {\r
+ @Override\r
+ public void onClick(ClickEvent event) {\r
FadeOut anim = new FadeOut(simplePanel){\r
@Override\r
protected void onComplete() {\r
hideMessage();\r
}\r
};\r
- anim.run(1000);\r
+ anim.run(500);\r
}\r
});\r
}\r
*/\r
public void displayError(final String msg) {\r
GWT.log(msg, null);\r
- message = new HTML("<table class='gss-errorMessage'><tr><td>" + images.error().getHTML() + "</td><td>" + msg + "</td></tr></table>");\r
- message.addClickListener(new ClickListener() {\r
+ message = new HTML("<table class='gss-errorMessage'><tr><td>" + AbstractImagePrototype.create(images.error()).getHTML() + "</td><td>" + msg + "</td></tr></table>");\r
+ message.addClickHandler(new ClickHandler() {\r
\r
- public void onClick(final Widget sender) {\r
+ @Override\r
+ public void onClick(ClickEvent event) {\r
FadeOut anim = new FadeOut(simplePanel){\r
\r
@Override\r
hideMessage();\r
}\r
};\r
- anim.run(1000);\r
+ anim.run(500);\r
}\r
});\r
buildPanel();\r
setVisible(true);\r
FadeIn anim = new FadeIn(simplePanel);\r
- anim.run(1000);\r
+ anim.run(500);\r
}\r
\r
/**\r
* @param msg the message to display\r
*/\r
public void displayWarning(final String msg) {\r
- message = new HTML("<table class='gss-warnMessage'><tr><td>" + images.warn().getHTML() + "</td><td>" + msg + "</td></tr></table>");\r
- message.addClickListener(new ClickListener() {\r
+ message = new HTML("<table class='gss-warnMessage'><tr><td>" + AbstractImagePrototype.create(images.warn()).getHTML() + "</td><td>" + msg + "</td></tr></table>");\r
+ message.addClickHandler(new ClickHandler() {\r
\r
- public void onClick(final Widget sender) {\r
+ @Override\r
+ public void onClick(ClickEvent event) {\r
FadeOut anim = new FadeOut(simplePanel){\r
\r
@Override\r
hideMessage();\r
}\r
};\r
- anim.run(1000);\r
+ anim.run(500);\r
}\r
});\r
\r
buildPanel();\r
setVisible(true);\r
FadeIn anim = new FadeIn(simplePanel);\r
- anim.run(1000);\r
+ anim.run(500);\r
}\r
\r
/**\r
* @param msg the message to display\r
*/\r
public void displayInformation(final String msg) {\r
- message = new HTML("<table class='gss-infoMessage'><tr><td>" + images.info().getHTML() + "</td><td>" + msg + "</td></tr></table>");\r
- message.addClickListener(new ClickListener() {\r
+ message = new HTML("<table class='gss-infoMessage'><tr><td>" + AbstractImagePrototype.create(images.info()).getHTML() + "</td><td>" + msg + "</td></tr></table>");\r
+ message.addClickHandler(new ClickHandler() {\r
\r
- public void onClick(final Widget sender) {\r
+ @Override\r
+ public void onClick(ClickEvent event) {\r
FadeOut anim = new FadeOut(simplePanel){\r
\r
@Override\r
hideMessage();\r
}\r
};\r
- anim.run(1000);\r
+ anim.run(500);\r
}\r
});\r
\r
buildPanel();\r
setVisible(true);\r
FadeIn anim = new FadeIn(simplePanel);\r
- anim.run(1000);\r
+ anim.run(500);\r
}\r
\r
/**\r