Date: prev next · Thread: first prev next last
2016 Archives by date, by thread · List index



  I have a working Java application that uses UNO with LibreOffice 5.
I'm using createInstanceWithContext for com.sun.star.frame.Desktop, but in the documentation it says that this interface is deprecated and we should use the "theDesktop singleton" instead:

http://api.libreoffice.org/docs/idl/ref/servicecom_1_1sun_1_1star_1_1frame_1_1Desktop.html#details

  However I haven't found any information on how to do that.

  I acquire the component loader as follows:

-----------------------------------------
com.sun.star.uno.XComponentContext       componentContext;
com.sun.star.lang.XMultiComponentFactory serviceManager;
com.sun.star.frame.XComponentLoader      componentLoader;
componentContext = com.sun.star.comp.helper.Bootstrap.bootstrap();
serviceManager   = componentContext.getServiceManager();
componentLoader  =
    UnoRuntime.queryInterface
    (com.sun.star.frame.XComponentLoader.class,
     serviceManager.createInstanceWithContext
     ("com.sun.star.frame.Desktop", componentContext)
     )
    ;
-----------------------------------------

I've tried writing "com.sun.star.frame.theDesktop" instead of the call to serviceManager.createInstanceWithContext() but that doesn't compile, then I tried some other semi-random stuff but nothing worked.

  How can I do that?
Is this documented anywhere, or is there any example that uses theDesktop instead of Desktop?

  Cheers,
--
    Alberto González Palomo
    Toledo, España / Saarbrücken, Deutschland
    http://www.matracas.org

Context


Privacy Policy | Impressum (Legal Info) | Copyright information: Unless otherwise specified, all text and images on this website are licensed under the Creative Commons Attribution-Share Alike 3.0 License. This does not include the source code of LibreOffice, which is licensed under the Mozilla Public License (MPLv2). "LibreOffice" and "The Document Foundation" are registered trademarks of their corresponding registered owners or are in actual use as trademarks in one or more countries. Their respective logos and icons are also subject to international copyright laws. Use thereof is explained in our trademark policy.