Package com.sun.star.uno

Examples of com.sun.star.uno.XComponentContext


                                            XDerived.class, test2Aa);

                                    Hashtable params = new Hashtable();
                                    params.put("UNO_TYPES", unoTypes);
                                    params.put("UNO_SERVICES", unoServices);
                                    XComponentContext context = Bootstrap.
                                       defaultBootstrap_InitialComponentContext(
                                            null, params);
                                    XMultiComponentFactory factory
                                        = context.getServiceManager();
                                    XImplementationLoader loader
                                        = (XImplementationLoader)
                                        UnoRuntime.queryInterface(
                                            XImplementationLoader.class,
                                            factory.createInstanceWithContext(
View Full Code Here


        if (storageManager == null) {
            try {
                XPropertySet xProp = (XPropertySet)UnoRuntime.queryInterface(
                    XPropertySet.class, xMSF);

                XComponentContext xContext = (XComponentContext)
                    UnoRuntime.queryInterface(XComponentContext.class,
                    xProp.getPropertyValue("DefaultContext"));

                XInterface ifc = (XInterface)
                    xContext.getValueByName("/singletons/drafts.com.sun.star." +
                    "script.framework.storage.theScriptStorageManager");

                storageManager = (XScriptStorageManager)
                    UnoRuntime.queryInterface(XScriptStorageManager.class, ifc);
            }
View Full Code Here

  public ImpressDocument loadDocument(String location, boolean hidden) {
    try {

      // get the remote office component context
      XComponentContext xContext = Bootstrap.bootstrap();
      logger.trace("Bootstrap OK");
      XMultiComponentFactory xMCF = xContext.getServiceManager();
      logger.trace("ServiceManager OK");
      Object desktop = xMCF.createInstanceWithContext(
          "com.sun.star.frame.Desktop", xContext);
      XComponentLoader loader = unoCast(XComponentLoader.class, desktop);
View Full Code Here

            // Get the default context from the office server.
            Object objectDefaultContext = xpropertysetMultiComponentFactory.getPropertyValue("DefaultContext");

            // Query for the interface XComponentContext.
            XComponentContext xcomponentcontext = (XComponentContext) UnoRuntime.queryInterface(XComponentContext.class, objectDefaultContext);

            /* A desktop environment contains tasks with one or more
               frames in which components can be loaded. Desktop is the
               environment for components which can instanciate within
               frames. */
 
View Full Code Here

        if (UtilValidate.isEmpty(host)) host = UtilProperties.getPropertyValue("openoffice-uno", "oo.host", "localhost");
        if (UtilValidate.isEmpty(port)) port = UtilProperties.getPropertyValue("openoffice-uno", "oo.port", "8100");

        XMultiComponentFactory xmulticomponentfactory = null;
        XComponentContext xcomponentcontext = null;
        Object objectUrlResolver = null;
        XUnoUrlResolver xurlresolver = null;
        Object objectInitial = null;
        // Converting the document to the favoured type
        try {
            /* Bootstraps a component context with the jurt base components
            registered. Component context to be granted to a component for running.
            Arbitrary values can be retrieved from the context. */
            xcomponentcontext = com.sun.star.comp.helper.Bootstrap.createInitialComponentContext(null);

            /* Gets the service manager instance to be used (or null). This method has
            been added for convenience, because the service manager is a often used
            object. */
            xmulticomponentfactory = xcomponentcontext.getServiceManager();

            /* Creates an instance of the component UnoUrlResolver which
            supports the services specified by the factory. */
            objectUrlResolver = xmulticomponentfactory.createInstanceWithContext("com.sun.star.bridge.UnoUrlResolver", xcomponentcontext);

View Full Code Here

    }

    public static List getFilterNames(XMultiComponentFactory xmulticomponentfactory) throws Exception {
        XPropertySet xPropertySet = (XPropertySet)UnoRuntime.queryInterface(XPropertySet.class, xmulticomponentfactory);
        Object oDefaultContext = xPropertySet.getPropertyValue("DefaultContext");
        XComponentContext xComponentContext = (XComponentContext) UnoRuntime.queryInterface(XComponentContext.class, oDefaultContext);


        Object filterFactory = xmulticomponentfactory.createInstanceWithContext("com.sun.star.document.FilterFactory", xComponentContext);
        XNameAccess xNameAccess = (XNameAccess)UnoRuntime.queryInterface(XNameAccess.class, filterFactory);
        String [] filterNames = xNameAccess.getElementNames();
View Full Code Here

        // Get the default context from the office server.
        Object objectDefaultContext = xpropertysetMultiComponentFactory.getPropertyValue("DefaultContext");

        // Query for the interface XComponentContext.
        XComponentContext xcomponentcontext = (XComponentContext) UnoRuntime.queryInterface(XComponentContext.class, objectDefaultContext);

        /* A desktop environment contains tasks with one or more
           frames in which components can be loaded. Desktop is the
           environment for components which can instanciate within
           frames. */
 
View Full Code Here

        // Get the default context from the office server.
        Object objectDefaultContext = xpropertysetMultiComponentFactory.getPropertyValue("DefaultContext");

        // Query for the interface XComponentContext.
        XComponentContext xcomponentcontext = (XComponentContext) UnoRuntime.queryInterface(XComponentContext.class, objectDefaultContext);

        /* A desktop environment contains tasks with one or more
           frames in which components can be loaded. Desktop is the
           environment for components which can instanciate within
           frames. */
 
View Full Code Here

     * @see com.sun.star.util.theMacroExpander
     */
    public static String expandMacro(XMultiServiceFactory xMSF, String expand) throws java.lang.Exception {
        try {
            XPropertySet xPS = (XPropertySet) UnoRuntime.queryInterface(XPropertySet.class, xMSF);
            XComponentContext xContext = (XComponentContext) UnoRuntime.queryInterface(XComponentContext.class,
                xPS.getPropertyValue("DefaultContext"));
            XMacroExpander xME = (XMacroExpander) UnoRuntime.queryInterface(XMacroExpander.class,
                xContext.getValueByName("/singletons/com.sun.star.util.theMacroExpander"));
            return xME.expandMacros(expand);
        } catch (Exception e) {
            throw new Exception("could not expand macro: " + e.toString(), e);
        }

View Full Code Here

        _xDispatch.dispatch(oURL, oArg);
    }

    public static XMultiComponentFactory getMultiComponentFactory() throws com.sun.star.uno.Exception, RuntimeException, java.lang.Exception
    {
        XComponentContext xcomponentcontext = Bootstrap.createInitialComponentContext(null);
        // initial serviceManager
        return xcomponentcontext.getServiceManager();
    }
View Full Code Here

TOP

Related Classes of com.sun.star.uno.XComponentContext

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.