X-Git-Url: https://code.grnet.gr/git/pithos-web-client/blobdiff_plain/cae2a8db2f7374b3dc9308ce08981dc21b4c7284..72199063dff2eb71ea76c46a69049db3017807f3:/src/gr/grnet/pithos/web/client/MessagePanel.java?ds=sidebyside diff --git a/src/gr/grnet/pithos/web/client/MessagePanel.java b/src/gr/grnet/pithos/web/client/MessagePanel.java index 5e30e5d..0cc44e5 100644 --- a/src/gr/grnet/pithos/web/client/MessagePanel.java +++ b/src/gr/grnet/pithos/web/client/MessagePanel.java @@ -1,5 +1,5 @@ /* - * Copyright 2011-2012 GRNET S.A. All rights reserved. + * Copyright 2011-2013 GRNET S.A. All rights reserved. * * Redistribution and use in source and binary forms, with or * without modification, are permitted provided that the following @@ -34,14 +34,12 @@ */ package gr.grnet.pithos.web.client; -import gr.grnet.pithos.web.client.animation.FadeIn; -import gr.grnet.pithos.web.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.Window; import com.google.gwt.user.client.ui.AbstractImagePrototype; import com.google.gwt.user.client.ui.Composite; import com.google.gwt.user.client.ui.HTML; @@ -93,12 +91,16 @@ public class MessagePanel extends Composite { * A link to send feedBack about the error. */ private HTML feedbackLink; + + Pithos app; + /** * The widget's constructor. * * @param newImages a bundle that provides the images for this widget */ - public MessagePanel(final Pithos app, final Images newImages) { + public MessagePanel(Pithos _app, final Images newImages) { + app = _app; images = newImages; simplePanel = new SimplePanel(); simplePanel.setStyleName("effectPanel"); @@ -113,15 +115,7 @@ public class MessagePanel extends Composite { @Override public void onClick(ClickEvent event) { - FadeOut anim = new FadeOut(simplePanel){ - - @Override - protected void onComplete() { - super.onComplete(); - hideMessage(); - } - }; - anim.run(500); + hideMessage(); } }); inner.add(message); @@ -137,14 +131,7 @@ public class MessagePanel extends Composite { @Override public void onClick(ClickEvent event) { - FadeOut anim = new FadeOut(simplePanel){ - @Override - protected void onComplete() { - super.onComplete(); - hideMessage(); - } - }; - anim.run(500); + hideMessage(); } }); linkPanel.add(clearMessageLink); @@ -176,8 +163,6 @@ public class MessagePanel extends Composite { message.setHTML("
" + AbstractImagePrototype.create(images.error()).getHTML() + "" + msg + "
"); feedbackLink.setVisible(true); setVisible(true); - FadeIn anim = new FadeIn(simplePanel); - anim.run(500); } /** @@ -189,8 +174,6 @@ public class MessagePanel extends Composite { message.setHTML("
" + AbstractImagePrototype.create(images.warn()).getHTML() + "" + msg + "
"); feedbackLink.setVisible(false); setVisible(true); - FadeIn anim = new FadeIn(simplePanel); - anim.run(500); } /** @@ -202,8 +185,6 @@ public class MessagePanel extends Composite { message.setHTML("
" + AbstractImagePrototype.create(images.info()).getHTML() + "" + msg + "
"); feedbackLink.setVisible(false); setVisible(true); - FadeIn anim = new FadeIn(simplePanel); - anim.run(500); } /** @@ -212,6 +193,6 @@ public class MessagePanel extends Composite { public void hideMessage() { message = new HTML(" "); this.setVisible(false); + app.onWindowResized(Window.getClientHeight()); } - }