code: public void centerHorizontally(int top) {
  
          if (Position.FIXED.getCssName().equals(getElement().getStyle().getPosition())) {
              show();
              // keep position fixed, as may have been set to absolute
              setPositionFixed();
              int left = (Window.getClientWidth() - getOffsetWidth()) >> 1;
              setPopupPosition(Math.max(left, 0), Math.max(top, 0));
          } else {
              show();
              int left = (Window.getClientWidth() - getOffsetWidth()) >> 1;
              setPopupPosition(Math.max(Window.getScrollLeft() + left, 0), Math.max(Window.getScrollTop() + top, 0));
          }
      }
docs: Shows the dialog and centers it horizontally, but positions it at a fixed vertical position.<p>
  
  @param top the top position