code: public XWindowPeer getWindowPeer(XTextDocument _xTextDocument){
          XModel xModel =  (XModel) UnoRuntime.queryInterface(XModel.class, _xTextDocument);
          XFrame xFrame = xModel.getCurrentController().getFrame();
          XWindow xWindow = xFrame.getContainerWindow();
          XWindowPeer xWindowPeer =  (XWindowPeer) UnoRuntime.queryInterface(XWindowPeer.class, xWindow);
          return xWindowPeer;
      }
docs: gets the WindowPeer of a frame
  @param _XTextDocument the instance of a textdocument
  @return the windowpeer of the frame