Package com.sun.star.container

Examples of com.sun.star.container.XSet


        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 = (XSet) UnoRuntime.queryInterface(
                    XSet.class, getORB());
            m_callbackFactory = new CallbackComponentFactory();
            globalFactory.insert(m_callbackFactory);

            // register ourself as listener at the global event broadcaster
            final XDocumentEventBroadcaster broadcaster = (XDocumentEventBroadcaster) UnoRuntime.queryInterface(
                    XDocumentEventBroadcaster.class, getORB().createInstance("com.sun.star.frame.GlobalEventBroadcaster"));
            broadcaster.addDocumentEventListener(this);
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

        try {
            if (oHandler != null) {
                oHandler.dispose();
            }
            if (MSF != null) {
                XSet xMSFSet = (XSet)UnoRuntime.queryInterface(XSet.class, MSF);
                xMSFSet.remove(oHandler);
                xMSFSet.remove(oFilter);
                xMSFSet.remove(oConnector);
                xMSFSet.remove(oDocumentHandler);
    xMSFSet.remove(oThreadRunner);
                xMSFSet.remove(oAttributeList);
            }
        } catch (Exception e){
            System.out.println(e.toString());
        }
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

            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

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

   
    public static void insertIntoServiceManager(
        XMultiComponentFactory serviceManager, Object singleFactory )
        throws com.sun.star.uno.Exception
    {
        XSet set = (XSet ) UnoRuntime.queryInterface( XSet.class, serviceManager );
        set.insert( singleFactory );
    }
View Full Code Here

    public static void removeFromServiceManager(
        XMultiComponentFactory serviceManager, Object singleFactory )
        throws com.sun.star.uno.Exception
    {
        XSet set = (XSet ) UnoRuntime.queryInterface( XSet.class, serviceManager );
        set.remove( singleFactory );
       
    }
View Full Code Here

         object. */
      XMultiComponentFactory xmulticomponentfactory =
      xcomponentcontext.getServiceManager();
     
      // Querying for the interface XSet on XMultiComponentFactory
      XSet xsetMultiServiceFactory = ( XSet ) UnoRuntime.queryInterface(
      XSet.class, xmulticomponentfactory );
     
      // Getting the XSingleServiceFactory for the minimal component
      XSingleServiceFactory xsingleservicefactoryMinimalComponent =
      MinimalComponent.__getServiceFactory(
      "MinimalComponent$MinimalComponentImplementation",
      ( XMultiServiceFactory ) UnoRuntime.queryInterface(
      XMultiServiceFactory.class, xmulticomponentfactory ),
      null );
     
      // Inserting the XSingleServiceFactory into the container
      xsetMultiServiceFactory.insert( xsingleservicefactoryMinimalComponent );
     
      // Creating an instance of the minimal component
      Object objectMinimalComponent =
      xmulticomponentfactory.createInstanceWithContext(
      "org.OpenOffice.MinimalComponent", xcomponentcontext );
     
      XServiceInfo xserviceinfoMinimalComponent = ( XServiceInfo )
      UnoRuntime.queryInterface( XServiceInfo.class,
      objectMinimalComponent );
     
      System.out.println( "\nXServiceInfo is used to get the implementation name:\n    -> " +
                          xserviceinfoMinimalComponent.getImplementationName() +
                          "\nOk");
     
      // Removing the XSingleServiceFactory of the minimal Component from the container
      xsetMultiServiceFactory.remove( xsingleservicefactoryMinimalComponent );
     
      xcomponentcontext = null;
     
      System.exit(0);
    }
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.