code: public void updateOptionBarPosition() {
  
          // only if attached to the DOM
          if ((m_elementOptionBar != null) && RootPanel.getBodyElement().isOrHasChild(getElement())) {
              int absoluteTop = getElement().getAbsoluteTop();
              int absoluteRight = getElement().getAbsoluteRight();
              CmsPositionBean dimensions = CmsPositionBean.getBoundingClientRect(getElement());
  
              int top = 0;
              int right = 0;
              int offsetLeft = 0;
              int offsetTop = 0;
  
              final Style style = m_elementOptionBar.getElement().getStyle();
  
              if (m_positioningInstructionParser.tryParse(getElement().getClassName())) {
                  offsetLeft = m_positioningInstructionParser.getOffsetLeft();
                  offsetTop = m_positioningInstructionParser.getOffsetTop();
              }
  
              if (Math.abs(absoluteTop - dimensions.getTop()) > 20) {
                  absoluteTop = (dimensions.getTop() - absoluteTop) + 2;
                  top = absoluteTop;
              }
              if (Math.abs(absoluteRight - dimensions.getLeft() - dimensions.getWidth()) > 20) {
                  absoluteRight = (absoluteRight - dimensions.getLeft() - dimensions.getWidth()) + 2;
                  right = absoluteRight;
              }
  
              top += offsetTop;
              right -= offsetLeft;
  
              if (top != 0) {
                  style.setTop(top, Unit.PX);
              } else {
                  style.clearTop();
              }
  
              if (right != 0) {
                  style.setRight(right, Unit.PX);
              } else {
                  style.clearRight();
              }
  
              if (isOptionbarIFrameCollision(absoluteTop, m_elementOptionBar.getCalculatedWidth())) {
                  style.setPosition(Position.RELATIVE);
                  int marginLeft = getElement().getClientWidth() - m_elementOptionBar.getCalculatedWidth();
                  if (marginLeft > 0) {
                      style.setMarginLeft(marginLeft, Unit.PX);
                  }
              } else {
                  style.clearPosition();
                  style.clearMarginLeft();
              }
          }
      }
docs: Updates the option bar position.<p>