diff options
author | Jouni Koivuviita <jouni.koivuviita@itmill.com> | 2009-08-31 09:25:47 +0000 |
---|---|---|
committer | Jouni Koivuviita <jouni.koivuviita@itmill.com> | 2009-08-31 09:25:47 +0000 |
commit | 08168c61a7f55b5f5948dcd855c3edd5f1c25462 (patch) | |
tree | ec2714c52ceea8fe865bf3a496ac318920421b8e /src/com | |
parent | bfe1ec30d6170420ec75a145994bc63b22f03125 (diff) | |
download | vaadin-framework-08168c61a7f55b5f5948dcd855c3edd5f1c25462.tar.gz vaadin-framework-08168c61a7f55b5f5948dcd855c3edd5f1c25462.zip |
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
Diffstat (limited to 'src/com')
-rw-r--r-- | src/com/vaadin/terminal/gwt/client/ui/VPopupView.java | 29 |
1 files changed, 16 insertions, 13 deletions
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<PopupPanel>() { + public void onClose(CloseEvent<PopupPanel> 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<Paintable> child) { + popup.updateShadowSizeAndPosition(); return true; } |