/** Show lightbox */ public void show() { int w = getWidth(); int h = getHeight(); background.setWidth(Integer.toString(w)); background.setHeight(Integer.toString(h)); if (GWT.isScript()) { background.setWidget(png = new PNGImage("images/lightbox.png", w, h)); } background.setPopupPosition(0, 0); hideSelects(); background.show(); backgroundFixup(background.getElement()); /** * Using setPopupPositionAndShow so child popup will not jump when centering * * @author Luis Faria */ child.setPopupPositionAndShow( new PositionCallback() { public void setPosition(int offsetWidth, int offsetHeight) { center(offsetWidth, offsetHeight); } }); }
private void showMessagePopup() { Label validationMessageLabel = new Label(); validationMessageLabel.setStyleName("validation-textbox-message-label"); // $NON-NLS-1$ validationMessageLabel.setText(getValidationMessage()); VerticalPanel messagePanel = new VerticalPanel(); messagePanel.add(validationMessageLabel); HorizontalPanel bottomPanel = new HorizontalPanel(); SimplePanel hSpacer = new SimplePanel(); hSpacer.setStylePrimaryName("validation-textbox-left-image-buffer"); // $NON-NLS-1$ bottomPanel.add(hSpacer); SimplePanel tailImagePanel = new SimplePanel(); image = new Image(GWT.getModuleBaseURL() + "images/spacer.gif"); // $NON-NLS-1$ image.setStylePrimaryName("validation-textbox-tail-image"); // $NON-NLS-1$ tailImagePanel.add(image); bottomPanel.add(tailImagePanel); messagePanel.add(bottomPanel); popupPanel = new PopupPanel(true, false); popupPanel.setWidget(messagePanel); popupPanel.setPopupPositionAndShow( new PositionCallback() { public void setPosition(int offsetWidth, int offsetHeight) { int absLeft = -1; int absTop = -1; absLeft = textBox.getAbsoluteLeft(); absTop = textBox.getAbsoluteTop(); Rectangle popupSize = ElementUtils.getSize(popupPanel.getElement()); popupPanel.setPopupPosition( absLeft, absTop - popupSize.height >= 0 ? absTop - popupSize.height : absTop); } }); popupPanel.show(); }
private void handleQuickReferenceClick() { if (isQuickReferenceShowing()) { quickReferencePopup.hide(); quickReferenceLink.setText(SHOW_QUICK_REFERENCE); } else { quickReferencePopup.setPopupPositionAndShow(this); quickReferenceLink.setText(HIDE_QUICK_REFERENCE); } }
@Override public void setDataList(List<KscReportDetail> dataList) { m_dataList.setList(dataList); m_popupPanel.setPopupPositionAndShow( new PositionCallback() { @Override public void setPosition(int offsetWidth, int offsetHeight) { m_popupPanel.setWidth((getOffsetWidth() - 5) + "px"); m_popupPanel.setPopupPosition(getAbsoluteLeft(), getAbsoluteTop() + 24); } }); }
/** Sets the popup's position using a PopupPanel.PositionCallback, and shows the popup. */ public void setPopupPositionAndShow(PopupPanel.PositionCallback callback) { popupPanel.setPopupPositionAndShow(callback); }