X-Git-Url: https://code.grnet.gr/git/pithos/blobdiff_plain/5c6b4b2c4cf6ba7db2ab1225ccec56d3a8dcbd14..ff8eb545cfab6483d485c8fc4c5b652bfe16bbdb:/src/gr/ebs/gss/client/MessagePanel.java
diff --git a/src/gr/ebs/gss/client/MessagePanel.java b/src/gr/ebs/gss/client/MessagePanel.java
index 4bce80e..e7135d4 100644
--- a/src/gr/ebs/gss/client/MessagePanel.java
+++ b/src/gr/ebs/gss/client/MessagePanel.java
@@ -22,17 +22,18 @@ import gr.ebs.gss.client.animation.FadeIn;
import gr.ebs.gss.client.animation.FadeOut;
import com.google.gwt.core.client.GWT;
+import com.google.gwt.event.dom.client.ClickEvent;
+import com.google.gwt.event.dom.client.ClickHandler;
+import com.google.gwt.resources.client.ClientBundle;
+import com.google.gwt.resources.client.ImageResource;
import com.google.gwt.user.client.DOM;
import com.google.gwt.user.client.ui.AbstractImagePrototype;
-import com.google.gwt.user.client.ui.ClickListener;
import com.google.gwt.user.client.ui.Composite;
import com.google.gwt.user.client.ui.HTML;
import com.google.gwt.user.client.ui.HasHorizontalAlignment;
import com.google.gwt.user.client.ui.HasVerticalAlignment;
import com.google.gwt.user.client.ui.HorizontalPanel;
-import com.google.gwt.user.client.ui.ImageBundle;
import com.google.gwt.user.client.ui.SimplePanel;
-import com.google.gwt.user.client.ui.Widget;
/**
* A panel that displays various system messages.
@@ -41,15 +42,15 @@ public class MessagePanel extends Composite {
/**
* An image bundle for this widget's images.
*/
- public interface Images extends ImageBundle {
- @Resource("gr/ebs/gss/resources/messagebox_info.png")
- AbstractImagePrototype info();
+ public interface Images extends ClientBundle {
+ @Source("gr/ebs/gss/resources/messagebox_info.png")
+ ImageResource info();
- @Resource("gr/ebs/gss/resources/messagebox_warning.png")
- AbstractImagePrototype warn();
+ @Source("gr/ebs/gss/resources/messagebox_warning.png")
+ ImageResource warn();
- @Resource("gr/ebs/gss/resources/messagebox_critical.png")
- AbstractImagePrototype error();
+ @Source("gr/ebs/gss/resources/messagebox_critical.png")
+ ImageResource error();
}
/**
@@ -102,10 +103,10 @@ public class MessagePanel extends Composite {
inner.add(message);
inner.add(clearMessageLink);
inner.setCellVerticalAlignment(message, HasVerticalAlignment.ALIGN_MIDDLE);
+ clearMessageLink.addClickHandler(new ClickHandler() {
- clearMessageLink.addClickListener(new ClickListener() {
-
- public void onClick(final Widget sender) {
+ @Override
+ public void onClick(ClickEvent event) {
FadeOut anim = new FadeOut(simplePanel){
@Override
protected void onComplete() {
@@ -113,7 +114,7 @@ public class MessagePanel extends Composite {
hideMessage();
}
};
- anim.run(1000);
+ anim.run(500);
}
});
}
@@ -125,10 +126,11 @@ public class MessagePanel extends Composite {
*/
public void displayError(final String msg) {
GWT.log(msg, null);
- message = new HTML("
" + images.error().getHTML() + " | " + msg + " |
");
- message.addClickListener(new ClickListener() {
+ message = new HTML("" + AbstractImagePrototype.create(images.error()).getHTML() + " | " + msg + " |
");
+ message.addClickHandler(new ClickHandler() {
- public void onClick(final Widget sender) {
+ @Override
+ public void onClick(ClickEvent event) {
FadeOut anim = new FadeOut(simplePanel){
@Override
@@ -137,13 +139,13 @@ public class MessagePanel extends Composite {
hideMessage();
}
};
- anim.run(1000);
+ anim.run(500);
}
});
buildPanel();
setVisible(true);
FadeIn anim = new FadeIn(simplePanel);
- anim.run(1000);
+ anim.run(500);
}
/**
@@ -152,10 +154,11 @@ public class MessagePanel extends Composite {
* @param msg the message to display
*/
public void displayWarning(final String msg) {
- message = new HTML("" + images.warn().getHTML() + " | " + msg + " |
");
- message.addClickListener(new ClickListener() {
+ message = new HTML("" + AbstractImagePrototype.create(images.warn()).getHTML() + " | " + msg + " |
");
+ message.addClickHandler(new ClickHandler() {
- public void onClick(final Widget sender) {
+ @Override
+ public void onClick(ClickEvent event) {
FadeOut anim = new FadeOut(simplePanel){
@Override
@@ -164,14 +167,14 @@ public class MessagePanel extends Composite {
hideMessage();
}
};
- anim.run(1000);
+ anim.run(500);
}
});
buildPanel();
setVisible(true);
FadeIn anim = new FadeIn(simplePanel);
- anim.run(1000);
+ anim.run(500);
}
/**
@@ -180,10 +183,11 @@ public class MessagePanel extends Composite {
* @param msg the message to display
*/
public void displayInformation(final String msg) {
- message = new HTML("" + images.info().getHTML() + " | " + msg + " |
");
- message.addClickListener(new ClickListener() {
+ message = new HTML("" + AbstractImagePrototype.create(images.info()).getHTML() + " | " + msg + " |
");
+ message.addClickHandler(new ClickHandler() {
- public void onClick(final Widget sender) {
+ @Override
+ public void onClick(ClickEvent event) {
FadeOut anim = new FadeOut(simplePanel){
@Override
@@ -192,14 +196,14 @@ public class MessagePanel extends Composite {
hideMessage();
}
};
- anim.run(1000);
+ anim.run(500);
}
});
buildPanel();
setVisible(true);
FadeIn anim = new FadeIn(simplePanel);
- anim.run(1000);
+ anim.run(500);
}
/**