@Override protected void onStart() { offsetHeight = curPanel.getOffsetHeight(); offsetWidth = curPanel.getOffsetWidth(); curPanel.getElement().getStyle().setProperty("overflow", "hidden"); super.onStart(); }
/** * Sets the popup's position using a {@link PositionCallback}, and shows the * popup. The callback allows positioning to be performed based on the * offsetWidth and offsetHeight of the popup, which are normally not available * until the popup is showing. By positioning the popup before it is shown, * the popup will not jump from its original position to the new position. * * @param callback the callback to set the position of the popup * @see PositionCallback#setPosition(int offsetWidth, int offsetHeight) */ public void setPopupPositionAndShow(PositionCallback callback) { setVisible(false); show(); callback.setPosition(getOffsetWidth(), getOffsetHeight()); setVisible(true); }
elem.getStyle().setPropertyPx("top", 0); int left = (Window.getClientWidth() - getOffsetWidth()) >> 1; int top = (Window.getClientHeight() - getOffsetHeight()) >> 1; setPopupPosition(Math.max(Window.getScrollLeft() + left, 0), Math.max(
@Override protected void onStart() { offsetHeight = curPanel.getOffsetHeight(); offsetWidth = curPanel.getOffsetWidth(); curPanel.getElement().getStyle().setProperty("overflow", "hidden"); super.onStart(); }
protected void configureColorPickerPopup(int left, int top, VerticalPanel popupContent) { popup.setWidget(popupContent); popup.show(); int finalLeft = left - popup.getOffsetWidth(); popup.setPopupPosition(finalLeft, top); }
protected void configureColorPickerPopup(int left, int top, VerticalPanel popupContent) { popup.setWidget(popupContent); popup.show(); int finalLeft = left - popup.getOffsetWidth(); popup.setPopupPosition(finalLeft, top); }
@Override protected void onStart() { offsetHeight = curPanel.getOffsetHeight(); offsetWidth = curPanel.getOffsetWidth(); curPanel.getElement().getStyle().setProperty("overflow", "hidden"); super.onStart(); }
/** * Sets the popup's position using a {@link PositionCallback}, and shows the * popup. The callback allows positioning to be performed based on the * offsetWidth and offsetHeight of the popup, which are normally not available * until the popup is showing. By positioning the popup before it is shown, * the popup will not jump from its original position to the new position. * * @param callback the callback to set the position of the popup * @see PositionCallback#setPosition(int offsetWidth, int offsetHeight) */ public void setPopupPositionAndShow(PositionCallback callback) { setVisible(false); show(); callback.setPosition(getOffsetWidth(), getOffsetHeight()); setVisible(true); }
/** * Sets the popup's position using a {@link PositionCallback}, and shows the * popup. The callback allows positioning to be performed based on the * offsetWidth and offsetHeight of the popup, which are normally not available * until the popup is showing. By positioning the popup before it is shown, * the popup will not jump from its original position to the new position. * * @param callback the callback to set the position of the popup * @see PositionCallback#setPosition(int offsetWidth, int offsetHeight) */ public void setPopupPositionAndShow(PositionCallback callback) { setVisible(false); show(); callback.setPosition(getOffsetWidth(), getOffsetHeight()); setVisible(true); }
int nRootWidth = Window.getClientWidth(); int nRootHeight = Window.getClientHeight(); int w = rPopupPanel.getOffsetWidth(); int h = rPopupPanel.getOffsetHeight();
style.setHeight(distanceToWindowBottom, Unit.PX); style.setOverflowY(Overflow.SCROLL); style.setWidth(popup.getOffsetWidth(), Unit.PX); int offsetWidthDiff = popup.getOffsetWidth() - relativeTargetOffsetWidth; if (distanceFromWindowLeft < popup.getOffsetWidth() && distanceToWindowRight >= offsetWidthDiff) { if (distanceToWindowRight < popup.getOffsetWidth() && distanceFromWindowLeft >= offsetWidthDiff) {
elem.getStyle().setPropertyPx("top", 0); int left = (Window.getClientWidth() - getOffsetWidth()) >> 1; int top = (Window.getClientHeight() - getOffsetHeight()) >> 1; setPopupPosition(Math.max(Window.getScrollLeft() + left, 0), Math.max(
elem.getStyle().setPropertyPx("top", 0); int left = (Window.getClientWidth() - getOffsetWidth()) >> 1; int top = (Window.getClientHeight() - getOffsetHeight()) >> 1; setPopupPosition(Math.max(Window.getScrollLeft() + left, 0), Math.max(
private void show(final DragContext context) { //Get centre of DropTarget final Widget dropTargetParent = context.dropController.getDropTarget(); int cxmin = dropTargetParent.getElement().getAbsoluteLeft(); int cymin = dropTargetParent.getElement().getAbsoluteTop(); int cxmax = dropTargetParent.getElement().getAbsoluteRight(); int cymax = dropTargetParent.getElement().getAbsoluteBottom(); final CoordinateArea ca = new CoordinateArea(cxmin, cymin, cxmax, cymax); //Display Compass if not already visible if (!popup.isAttached()) { popup.setPopupPositionAndShow(new PopupPanel.PositionCallback() { @Override public void setPosition(int offsetWidth, int offsetHeight) { popup.setPopupPosition(ca.getCenter().getLeft() - (offsetWidth / 2), ca.getCenter().getTop() - (offsetHeight / 2)); } }); } else { popup.setPopupPosition(ca.getCenter().getLeft() - (popup.getOffsetWidth() / 2), ca.getCenter().getTop() - (popup.getOffsetHeight() / 2)); } }
private void show(final DragContext context) { //Get centre of DropTarget final Widget dropTargetParent = context.dropController.getDropTarget(); int cxmin = dropTargetParent.getElement().getAbsoluteLeft(); int cymin = dropTargetParent.getElement().getAbsoluteTop(); int cxmax = dropTargetParent.getElement().getAbsoluteRight(); int cymax = dropTargetParent.getElement().getAbsoluteBottom(); final CoordinateArea ca = new CoordinateArea(cxmin, cymin, cxmax, cymax); //Display Compass if not already visible if (!popup.isAttached()) { popup.setPopupPositionAndShow(new PopupPanel.PositionCallback() { @Override public void setPosition(int offsetWidth, int offsetHeight) { popup.setPopupPosition(ca.getCenter().getLeft() - (offsetWidth / 2), ca.getCenter().getTop() - (offsetHeight / 2)); } }); } else { popup.setPopupPosition(ca.getCenter().getLeft() - (popup.getOffsetWidth() / 2), ca.getCenter().getTop() - (popup.getOffsetHeight() / 2)); } }