Package com.sun.star.lang

Examples of com.sun.star.lang.XInitialization


            PropertyValue[] aProperties = new PropertyValue[4];
            aProperties[0] = Properties.createProperty("ActiveConnection", curTableDescriptor.DBConnection);
            aProperties[1] = Properties.createProperty("DataSource", curTableDescriptor.getDataSource());
            aProperties[2] = Properties.createProperty("CommandType", new Integer(CommandType.TABLE));
            aProperties[3] = Properties.createProperty("Command", scomposedtablename);
            XInitialization xInitialization = (XInitialization) UnoRuntime.queryInterface(XInitialization.class, oFormWizard);
            xInitialization.initialize(aProperties);
            XJobExecutor xJobExecutor = (XJobExecutor) UnoRuntime.queryInterface(XJobExecutor.class, oFormWizard);
            xJobExecutor.trigger("start");
            XPropertySet prop = (XPropertySet) UnoRuntime.queryInterface(XPropertySet.class, xJobExecutor);
            components[0] = (XComponent) prop.getPropertyValue("Document");
            components[1] = (XComponent) prop.getPropertyValue("DocumentDefinition");
View Full Code Here


                                      .createInstance("com.sun.star.configuration.bootstrap.BootstrapContext");
            backend = (XInterface) ((XMultiServiceFactory)tParam.getMSF())
                                      .createInstanceWithArguments("com.sun.star.comp.configuration.backend.LocalSingleBackend",args);           
            oObj = (XInterface) ((XMultiServiceFactory)tParam.getMSF())
                                      .createInstance("com.sun.star.comp.configuration.backend.SingleBackendAdapter");
                        XInitialization xInit = (XInitialization) UnoRuntime.queryInterface(
                                            XInitialization.class, oObj);
           
            xInit.initialize(new Object[] { backend });
        } catch (com.sun.star.uno.Exception e) {
            e.printStackTrace();
        }

        log.println("Implementation name: "+ util.utils.getImplName(oObj));       
View Full Code Here

    // Create an instance of the ServiceManager
    XMultiComponentFactory xSMgr = UnoRuntime.queryInterface(
            XMultiComponentFactory.class, smgr_fac.createInstanceWithContext( null ) );
       
    // post init loader
    XInitialization xInit = UnoRuntime.queryInterface(
            XInitialization.class, xImpLoader );
    Object[] args = new Object [] { xSMgr };
    xInit.initialize( args );
       
        // initial component context
        if (context_entries == null)
            context_entries = new Hashtable( 1 );
        // add smgr
        context_entries.put(
            "/singletons/com.sun.star.lang.theServiceManager",
            new ComponentContextEntry( null, xSMgr ) );
        // ... xxx todo: add standard entries
        XComponentContext xContext = new ComponentContext( context_entries, null );
       
        // post init smgr
    xInit = UnoRuntime.queryInterface(
            XInitialization.class, xSMgr );
    args = new Object [] { null, xContext }; // no registry, default context
    xInit.initialize( args );
       
    XSet xSet = UnoRuntime.queryInterface( XSet.class, xSMgr );
    // insert the service manager
    xSet.insert( smgr_fac );
        // and basic jurt factories
View Full Code Here

    public final Object createInstanceWithArgumentsAndContext(
        Object arguments [], XComponentContext xContext )
        throws com.sun.star.uno.Exception
    {
        Object inst = instantiate( xContext );
        XInitialization xInit = UnoRuntime.queryInterface(
            XInitialization.class, inst );
        if (null == xInit)
        {
      throw new com.sun.star.lang.IllegalArgumentException(
                "cannot pass arguments to component; no XInitialization implemented!", this,
                (short)0 );
        }
        xInit.initialize( arguments );
        return inst;
    }
View Full Code Here

    // Create an instance of the ServiceManager
    XMultiComponentFactory xSMgr = (XMultiComponentFactory)UnoRuntime.queryInterface(
            XMultiComponentFactory.class, smgr_fac.createInstanceWithContext( null ) );
       
    // post init loader
    XInitialization xInit = (XInitialization)UnoRuntime.queryInterface(
            XInitialization.class, xImpLoader );
    Object[] args = new Object [] { xSMgr };
    xInit.initialize( args );
       
        // initial component context
        if (context_entries == null)
            context_entries = new Hashtable( 1 );
        // add smgr
        context_entries.put(
            "/singletons/com.sun.star.lang.theServiceManager",
            new ComponentContextEntry( null, xSMgr ) );
        // ... xxx todo: add standard entries
        XComponentContext xContext = new ComponentContext( context_entries, null );
       
        // post init smgr
    xInit = (XInitialization)UnoRuntime.queryInterface(
            XInitialization.class, xSMgr );
    args = new Object [] { null, xContext }; // no registry, default context
    xInit.initialize( args );
       
    XSet xSet = (XSet)UnoRuntime.queryInterface( XSet.class, xSMgr );
    // insert the service manager
    xSet.insert( smgr_fac );
        // and basic jurt factories
View Full Code Here

            catch( Exception e ) {
            }
       
            //!! workaround for services not always being created
            //!! via 'createInstanceWithArguments'
            XInitialization xIni = (XInitialization) UnoRuntime.queryInterface(
                XInitialization.class, createInstance());
            if (xIni != null)
            {
                Object[] aArguments = new Object[]{ null, null };
                if (xMultiFactory != null)
                {
                    XPropertySet xPropSet = (XPropertySet) UnoRuntime.queryInterface(
                        XPropertySet.class ,  xMultiFactory.createInstance(
                            "com.sun.star.linguistic2.LinguProperties" ) );
                    aArguments[0] = xPropSet;
                }                           
                xIni.initialize( aArguments );
            }
        }
        return xInstantiatedService;
    }
View Full Code Here

        throws com.sun.star.uno.Exception,
               com.sun.star.uno.RuntimeException
    {
        if (xInstantiatedService == null)
        {
            XInitialization xIni = (XInitialization) UnoRuntime.queryInterface(
                XInitialization.class, createInstance());
            if (xIni != null)
                xIni.initialize( aArguments );
        }
        return xInstantiatedService;
    }
View Full Code Here

            catch( Exception e ) {
            }
       
            //!! workaround for services not always being created
            //!! via 'createInstanceWithArguments'
            XInitialization xIni = (XInitialization) UnoRuntime.queryInterface(
                XInitialization.class, createInstance());
            if (xIni != null)
            {
                Object[] aArguments = new Object[]{ null, null };
                if (xMultiFactory != null)
                {
                    XPropertySet xPropSet = (XPropertySet) UnoRuntime.queryInterface(
                        XPropertySet.class ,  xMultiFactory.createInstance(
                            "com.sun.star.linguistic2.LinguProperties" ) );
                    aArguments[0] = xPropSet;
                }                           
                xIni.initialize( aArguments );
            }
        }
        return xInstantiatedService;
    }
View Full Code Here

        throws com.sun.star.uno.Exception,
               com.sun.star.uno.RuntimeException
    {
        if (xInstantiatedService == null)
        {
            XInitialization xIni = (XInitialization) UnoRuntime.queryInterface(
                XInitialization.class, createInstance());
            if (xIni != null)
                xIni.initialize( aArguments );
        }
        return xInstantiatedService;
    }
View Full Code Here

        the_frame2.setName("DatasourceBrowser");

        XInterface oObj = null;

        final XInitialization xInit = (XInitialization)
                UnoRuntime.queryInterface(
                        XInitialization.class, the_frame2.getController());

        Object[] params = new Object[3];
        PropertyValue param1 = new PropertyValue();
View Full Code Here

TOP

Related Classes of com.sun.star.lang.XInitialization

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.