@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); }
int top = (Window.getClientHeight() - getOffsetHeight()) >> 1; setPopupPosition(Math.max(Window.getScrollLeft() + left, 0), Math.max( Window.getScrollTop() + top, 0));
@Override protected void onStart() { offsetHeight = curPanel.getOffsetHeight(); offsetWidth = curPanel.getOffsetWidth(); curPanel.getElement().getStyle().setProperty("overflow", "hidden"); super.onStart(); }
@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); }
/*************************************** * Handles clicks on a button that manipulates the filter criteria list. * * @param rEvent The click event that occurred * @param bAdd TRUE to add a row, FALSE to remove the row of the button */ private void handleFilterListChangeButton(ClickEvent rEvent, boolean bAdd) { if (bAdd) { addFilterRow(-1, ' ', null, false); } else { int nRow = findFilterCriterionRow(COL_FILTER_BUTTON, (Widget) rEvent.getSource()); aFilterCriteriaPanel.removeRow(nRow); } updateFilterPopupPosition(aFilterPopup.getOffsetHeight()); }
int nRootHeight = Window.getClientHeight(); int w = rPopupPanel.getOffsetWidth(); int h = rPopupPanel.getOffsetHeight();
int top = (Window.getClientHeight() - getOffsetHeight()) >> 1; setPopupPosition(Math.max(Window.getScrollLeft() + left, 0), Math.max( Window.getScrollTop() + top, 0));
if (distanceToWindowBottom >= popup.getOffsetHeight()) { } else if (distanceFromWindowTop >= popup.getOffsetHeight()) { top -= popup.getOffsetHeight() - itemHeight; } else {// Position above the relative object and add scroll top += relativeHeight;
int top = (Window.getClientHeight() - getOffsetHeight()) >> 1; setPopupPosition(Math.max(Window.getScrollLeft() + left, 0), Math.max( Window.getScrollTop() + top, 0));
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)); } }