mxRemoteServiceManager = this.getRemoteServiceManager();
// get the Desktop service
Object desktop = mxRemoteServiceManager.createInstanceWithContext(
"com.sun.star.frame.Desktop", mxRemoteContext);
// query its XDesktop interface, we need the current component
XDesktop xDesktop = (XDesktop)UnoRuntime.queryInterface(
XDesktop.class, desktop);
// retrieve the current component and access the controller
XComponent xCurrentComponent = xDesktop.getCurrentComponent();
XModel xModel = (XModel)UnoRuntime.queryInterface(XModel.class,
xCurrentComponent);
XController xController = xModel.getCurrentController();
// the controller gives us the TextViewCursor
XTextViewCursorSupplier xViewCursorSupplier =