From: Jouni Koivuviita Date: Mon, 31 Aug 2009 09:25:47 +0000 (+0000) Subject: Fixes #3215: Popup shadow doesn't resize with panel X-Git-Tag: 6.7.0.beta1~2566 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=08168c61a7f55b5f5948dcd855c3edd5f1c25462;p=vaadin-framework.git Fixes #3215: Popup shadow doesn't resize with panel Fixes #3247: VPopupView contains hard coded text "Loading..." -loading text replaced with a spinning loading icon (in CSS). svn changeset:8594/svn branch:6.1 --- diff --git a/src/com/vaadin/terminal/gwt/client/ui/VPopupView.java b/src/com/vaadin/terminal/gwt/client/ui/VPopupView.java index 69acd0962d..46e35f2cb8 100644 --- a/src/com/vaadin/terminal/gwt/client/ui/VPopupView.java +++ b/src/com/vaadin/terminal/gwt/client/ui/VPopupView.java @@ -5,13 +5,14 @@ import java.util.Set; import com.google.gwt.event.dom.client.ClickEvent; import com.google.gwt.event.dom.client.ClickHandler; +import com.google.gwt.event.logical.shared.CloseEvent; +import com.google.gwt.event.logical.shared.CloseHandler; import com.google.gwt.user.client.DOM; import com.google.gwt.user.client.Element; import com.google.gwt.user.client.Event; import com.google.gwt.user.client.ui.Focusable; import com.google.gwt.user.client.ui.HTML; import com.google.gwt.user.client.ui.Label; -import com.google.gwt.user.client.ui.PopupListener; import com.google.gwt.user.client.ui.PopupPanel; import com.google.gwt.user.client.ui.RootPanel; import com.google.gwt.user.client.ui.Widget; @@ -38,7 +39,7 @@ public class VPopupView extends HTML implements Container { private boolean hostPopupVisible; private final CustomPopup popup; - private final Label loading = new Label("Loading..."); + private final Label loading = new Label(); /** * loading constructor @@ -49,8 +50,9 @@ public class VPopupView extends HTML implements Container { setStyleName(CLASSNAME); popup.setStylePrimaryName(CLASSNAME + "-popup"); + loading.setStyleName(CLASSNAME + "-loading"); - setHTML("(No HTML defined for PopupView)"); + setHTML(""); popup.setWidget(loading); // When we click to open the popup... @@ -61,8 +63,8 @@ public class VPopupView extends HTML implements Container { }); // ..and when we close it - popup.addPopupListener(new PopupListener() { - public void onPopupClosed(PopupPanel sender, boolean autoClosed) { + popup.addCloseHandler(new CloseHandler() { + public void onClose(CloseEvent event) { updateState(false); } }); @@ -72,8 +74,8 @@ public class VPopupView extends HTML implements Container { } /** - * - * + * + * * @see com.vaadin.terminal.gwt.client.Paintable#updateFromUIDL(com.vaadin.terminal.gwt.client.UIDL, * com.vaadin.terminal.gwt.client.ApplicationConnection) */ @@ -128,7 +130,7 @@ public class VPopupView extends HTML implements Container { /** * Update popup visibility to server - * + * * @param visibility */ private void updateState(boolean visible) { @@ -185,7 +187,7 @@ public class VPopupView extends HTML implements Container { /** * Make sure that we remove the popup when the main widget is removed. - * + * * @see com.google.gwt.user.client.ui.Widget#onUnload() */ @Override @@ -322,13 +324,13 @@ public class VPopupView extends HTML implements Container { } /* - * + * * We need a hack make popup act as a child of VPopupView in Vaadin's * component tree, but work in default GWT manner when closing or * opening. - * + * * (non-Javadoc) - * + * * @see com.google.gwt.user.client.ui.Widget#getParent() */ @Override @@ -365,7 +367,7 @@ public class VPopupView extends HTML implements Container { /** * Calculate extra space taken by the popup decorations - * + * * @return */ protected Size calculatePopupExtra() { @@ -393,6 +395,7 @@ public class VPopupView extends HTML implements Container { } public boolean requestLayout(Set child) { + popup.updateShadowSizeAndPosition(); return true; }