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;
private boolean hostPopupVisible;
private final CustomPopup popup;
- private final Label loading = new Label("Loading...");
+ private final Label loading = new Label();
/**
* loading constructor
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...
});
// ..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);
}
});
}
/**
- *
- *
+ *
+ *
* @see com.vaadin.terminal.gwt.client.Paintable#updateFromUIDL(com.vaadin.terminal.gwt.client.UIDL,
* com.vaadin.terminal.gwt.client.ApplicationConnection)
*/
/**
* Update popup visibility to server
- *
+ *
* @param visibility
*/
private void updateState(boolean visible) {
/**
* Make sure that we remove the popup when the main widget is removed.
- *
+ *
* @see com.google.gwt.user.client.ui.Widget#onUnload()
*/
@Override
}
/*
- *
+ *
* 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
/**
* Calculate extra space taken by the popup decorations
- *
+ *
* @return
*/
protected Size calculatePopupExtra() {
}
public boolean requestLayout(Set<Paintable> child) {
+ popup.updateShadowSizeAndPosition();
return true;
}