Package com.sun.star.container

Examples of com.sun.star.container.XSet


      XComponent xcomponent = xcomponentloader.loadComponentFromURL(
      "private:factory/scalc", "_blank", 0,
      new PropertyValue[0] );
     
      // Querying for the interface XSet on the XMultiServiceFactory
      XSet xsetMultiComponentFactory = ( XSet ) UnoRuntime.queryInterface(
      XSet.class, xmulticomponentfactory );
     
      // Getting the single service factory of the instance inspector
      XSingleServiceFactory xsingleservicefactoryInstanceInspector =
      InstanceInspector.__getServiceFactory(
      "InstanceInspector$_InstanceInspector", ( XMultiServiceFactory )
      UnoRuntime.queryInterface( XMultiServiceFactory.class,
      xmulticomponentfactory ), null );
     
      // Inserting the single service factory into the multi service factory
      // Only for this example, so this example is independent of deplying the
      // InstanceInspector component in your office.
      xsetMultiComponentFactory.insert( xsingleservicefactoryInstanceInspector );
     
      // Creating an instance of the instance inspector with arguments
      Object objectInstanceInspector =
      xmulticomponentfactory.createInstanceWithArgumentsAndContext(
      "org.OpenOffice.InstanceInspector",
      new Object[]{ xmulticomponentfactory }, xcomponentcontext );
     
      // Create a new instance inspector
      XInstanceInspector xinstanceinspector = ( XInstanceInspector )
      UnoRuntime.queryInterface( XInstanceInspector.class,
      objectInstanceInspector );
     
      // Inspect the calc
      xinstanceinspector.inspect( xcomponent );
     
      // Remove instance inspector from the container
      xsetMultiComponentFactory.remove( xsingleservicefactoryInstanceInspector );   

      System.out.println("\nPlease inspect the new spreadsheet document component." +
                         " Press RETURN to exit");
      DataInputStream inputStream = new DataInputStream(System.in);
      inputStream.read();
View Full Code Here


            // Querying for the interface XSpreadsheetDocument on XComponent
            XSpreadsheetDocument xspreadsheetdocument = ( XSpreadsheetDocument )
            UnoRuntime.queryInterface( XSpreadsheetDocument.class, xcomponent );
           
            // Querying for the interface XSet on the XMultiComponentFactory
            XSet xsetMultiComponentFactory = ( XSet ) UnoRuntime.queryInterface(
            XSet.class, xmulticomponentfactory );
           
            // Getting the XSingleServiceFactory for the ToDo component
            XSingleServiceFactory xsingleservicefactoryToDo =
            ToDo.__getServiceFactory( "ToDo$_ToDo", ( XMultiServiceFactory )
            UnoRuntime.queryInterface( XMultiServiceFactory.class,
            xmulticomponentfactory ), null );
           
            // Inserting the XSingleServiceFactory into the container
            xsetMultiComponentFactory.insert( xsingleservicefactoryToDo );
           
            // Creating an instance of the ToDo component
            Object objectToDo =
            xmulticomponentfactory.createInstanceWithContext(
            "org.openoffice.ToDo", xcomponentcontext );
           
            if ( objectToDo != null ) {
                // Querying for the interface XToDo
                XToDo xToDo = ( XToDo )
                UnoRuntime.queryInterface( XToDo.class, objectToDo );
               
                // Recalculate the spreadsheet
                xToDo.recalc( xspreadsheetdocument );
            }
           
            // Removing the XSingleServiceFactory of ToDo from the container
            xsetMultiComponentFactory.remove( xsingleservicefactoryToDo );
           
            System.exit(0);
        }
        catch( Exception exception ) {
            System.err.println( exception );
View Full Code Here

            XPropertySet xProps = UnoRuntime.queryInterface(
                XPropertySet.class, xMgr );
            XComponentContext xContext = (XComponentContext)AnyConverter.toObject(
                new Type( XComponentContext.class ), xProps.getPropertyValue( "DefaultContext" ) );
            // insert java loader
            XSet xSet = (XSet)AnyConverter.toObject(
                new Type( XSet.class ), xContext.getServiceManager() );
            xSet.insert( new com.sun.star.comp.loader.JavaLoaderFactory( xMgr ) );
            // get rdb of smgr
            XSimpleRegistry xRDB = (XSimpleRegistry)AnyConverter.toObject(
                new Type( XSimpleRegistry.class ), xProps.getPropertyValue( "Registry" ) );
            // register impl
            XImplementationRegistration xImpReg =
View Full Code Here

            log.println("Error creating SimpleServiceManager :");
            ex.printStackTrace(log);
        }

        try {
            XSet set = (XSet) UnoRuntime.queryInterface
                (XSet.class, oInterface) ;
            XSet set1 = (XSet) UnoRuntime.queryInterface
                (XSet.class, srvMan) ;
            XEnumeration oEnum = set1.createEnumeration();
            Object srv = oEnum.nextElement();

            set.insert(srv) ;

            newElement = oEnum.nextElement();
View Full Code Here

            log.println("Error creating SimpleServiceManager :");
            ex.printStackTrace(log);
        }

        try {
            XSet set = (XSet) UnoRuntime.queryInterface
                (XSet.class, oInterface) ;
            XSet set1 = (XSet) UnoRuntime.queryInterface
                (XSet.class, srvMan) ;
            XEnumeration oEnum = set1.createEnumeration();
            Object srv = oEnum.nextElement();

            set.insert(srv) ;

            newElement = oEnum.nextElement();
View Full Code Here

        m_undoListener = null;

        // at our service factory, insert a new factory for our CallbackComponent
        // this will allow the Basic code in our test documents to call back into this test case
        // here, by just instantiating this service
        final XSet globalFactory = UnoRuntime.queryInterface( XSet.class, getORB() );
        m_callbackFactory = new CallbackComponentFactory();
        globalFactory.insert( m_callbackFactory );
    }
View Full Code Here

        try
        {
            // at our service factory, insert a new factory for our CallbackComponent
            // this will allow the Basic code in our test documents to call back into this test case
            // here, by just instantiating this service
            final XSet globalFactory = UnoRuntime.queryInterface(XSet.class, getMSF());
            m_callbackFactory = new CallbackComponentFactory();
            globalFactory.insert(m_callbackFactory);

            // register ourself as listener at the global event broadcaster
            final XDocumentEventBroadcaster broadcaster = UnoRuntime.queryInterface(XDocumentEventBroadcaster.class, getMSF().createInstance("com.sun.star.frame.GlobalEventBroadcaster"));
            broadcaster.addDocumentEventListener(this);
        }
View Full Code Here

        XMultiComponentFactory smgr = ctx.getServiceManager();
        XMultiServiceFactory oldsmgr =
            UnoRuntime.queryInterface( XMultiServiceFactory.class, smgr );

        // prepare servicemanager
        XSet set = UnoRuntime.queryInterface(XSet.class, smgr);
        Object o = com.sun.star.comp.bridge.TestComponent.__getServiceFactory(
            "com.sun.star.comp.bridge.TestComponent$_TestObject", oldsmgr,null );
        set.insert(o);
       
    XAcceptor xAcceptor = Acceptor.create(ctx);

        while( true )
        {
View Full Code Here

    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
        insertBasicFactories( xSet, xImpLoader );
       
    return xContext;
  }
View Full Code Here

            oFilter = new Filter();
            oDocumentHandler = new DocumentHandler();
      oThreadRunner = new ThreadRunner(xMSF);
            oCeptor = new DispatchProviderInterceptor() ;
            oAttributeList = new AttributeList();
            XSet xMSFSet = (XSet)UnoRuntime.queryInterface(XSet.class, xMSF);

            try {
                xMSFSet.insert(oHandler);
                xMSFSet.insert(oConnector);
                xMSFSet.insert(oFilter);
                xMSFSet.insert(oDocumentHandler);
    xMSFSet.insert(oThreadRunner);
                xMSFSet.insert(oCeptor);
                xMSFSet.insert(oAttributeList);
            } catch (ElementExistException e) {
                System.out.println(e.toString());
            } catch (IllegalArgumentException e) {
                System.out.println(e.toString());
            }
View Full Code Here

TOP

Related Classes of com.sun.star.container.XSet

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.