code: public static int getScrollToMiddle (Widget target)
      {
          int wheight = Window.getClientHeight(), theight = target.getOffsetHeight();
          int ttop = target.getAbsoluteTop();
          return Math.max(ttop, ttop + (wheight - theight));
      }
docs: Returns the vertical scroll position needed to center the target widget vertically in the
  browser viewport. If the widget is taller than the viewport, its top is returned.