Package com.sun.star.lang

Examples of com.sun.star.lang.XMultiServiceFactory


        Point position = new Point();
        XControlShape oCShape = null;
        XControlModel aControl = null;

        //get MSF
       XMultiServiceFactory oDocMSF = (XMultiServiceFactory) UnoRuntime.queryInterface( XMultiServiceFactory.class, oDoc );

       try{
         Object oInt = oDocMSF.createInstance("com.sun.star.drawing.ControlShape");
         Object aCon = oDocMSF.createInstance("com.sun.star.form.component."+kind);
         aControl = (XControlModel) UnoRuntime.queryInterface( XControlModel.class, aCon );
         oCShape = (XControlShape) UnoRuntime.queryInterface( XControlShape.class, oInt );
         size.Height = height;
     size.Width = width;
     position.X = x;
View Full Code Here


        log.println("Choose Port nr: " + curPort);

        connectStr += curPort;

        try {
            XMultiServiceFactory xMSF = (XMultiServiceFactory)tParam.getMSF();

            // get the bridge factory
            XBridgeFactory xBrdgFctr = (XBridgeFactory)
                        UnoRuntime.queryInterface(XBridgeFactory.class,
                                    tEnv.getObjRelation("BRIDGEFACTORY"));

            // get the acceptor
            XAcceptor xAcc = (XAcceptor)UnoRuntime.queryInterface(
                    XAcceptor.class, tEnv.getObjRelation("ACCEPTOR"));

            // instance provider
            XInstanceProvider xInstProv = new MyInstanceProvider(xMSF);
            // thread for providing a bridge
            BridgeThread brThread = new BridgeThread(xAcc, xBrdgFctr,
                                            xInstProv, connectStr);
            brThread.start();

            try {
                Thread.sleep(500);
            }
            catch(java.lang.InterruptedException e) {}
            // get an instance from the remote
            Object obj = oObj.resolve(
                    "uno:" + connectStr + ";urp;com.sun.star.lang.ServiceManager");
            // got the instance?
            XMultiServiceFactory oMSF = (XMultiServiceFactory)
                    UnoRuntime.queryInterface(XMultiServiceFactory.class, obj);

            if (brThread.isAlive())
                brThread.interrupt();
View Full Code Here

     * greater then 0 (because JAR file contains at least one entry).
     */
    public void _createSortedDynamicResultSet() {
        boolean result = true ;

        XMultiServiceFactory xMSF = (XMultiServiceFactory)tParam.getMSF();
        XDynamicResultSet dynResSet = null ;
        try {
            Object oUCB = xMSF.createInstanceWithArguments
                ("com.sun.star.ucb.UniversalContentBroker",
                new Object[] {"Local", "Office"}) ;

            XContentIdentifierFactory ciFac = (XContentIdentifierFactory)
                UnoRuntime.queryInterface
View Full Code Here

*
* If no test fails, the test is well done and returns with 'PASSED, OK'
*
*/    public void testXUnitConversion()
        {
            XMultiServiceFactory xMSF = (XMultiServiceFactory) param.getMSF();
            assure("failed: There is no office.", xMSF != null);

            // create a window
            XWindowPeer xWindowPeer = DesktopTools.createFloatingWindow(xMSF);
            assure("failed: there is no window peer", xWindowPeer != null);
View Full Code Here

            String rdb = "file://" + new java.io.File( args[ 1 ] ).toURL().getPath();
            System.out.println( "jar file = " + jar );
            System.out.println( "rdb file = " + rdb );
       
            // bootstrap service manager
            XMultiServiceFactory xMgr = RegistryServiceFactory.create( rdb );
            XPropertySet xProps = (XPropertySet)UnoRuntime.queryInterface(
                XPropertySet.class, xMgr );
            XComponentContext xContext = (XComponentContext)AnyConverter.toObject(
                new Type( XComponentContext.class ), xProps.getPropertyValue( "DefaultContext" ) );
            // insert java loader
View Full Code Here

  }

  public void checkWrongFtpConnection() {
    //localhost  ;Lo-1.Germany.sun.com; 10.16.65.155
    try {
      XMultiServiceFactory xLocMSF = (XMultiServiceFactory)param.getMSF();
      String acountUrl = "ftp://noname:nopasswd@nohost";
      log.println(acountUrl);
      init(xLocMSF);
      Object content = getContent(acountUrl);
View Full Code Here

            {
                throw new Exception(
                    "no /singletons/com.sun.star.reflection.theTypeDescriptionManager!" );
            }
           
      XMultiServiceFactory msf = (XMultiServiceFactory)UnoRuntime.queryInterface(
                XMultiServiceFactory.class, xContext.getServiceManager() );
      String services[] = msf.getAvailableServiceNames();
      System.out.println("Available services are:");
      System.err.println();
      if (services.length == 0)
        System.out.println("No services avialable!");
View Full Code Here

    System.out.println("*******************************************************************");
    System.err.println("RegistryServiceFactory - doing tests...");
    System.err.println();

    try {
      XMultiServiceFactory msf = RegistryServiceFactory.create( applicat );
      String services[] = msf.getAvailableServiceNames();
      System.out.println("Available services are:");
      System.err.println();
      if (services.length == 0)
        System.out.println("No services avialable!");

View Full Code Here

     * @throws Exception Exception
     */
    public void before() throws Exception {

        // create TypeDetection
        XMultiServiceFactory xMSF = (XMultiServiceFactory)param.getMSF();
        assure("Could not get XMultiServiceFactory", xMSF != null);
       
        Object oInterface = xMSF.createInstance(
                                        "com.sun.star.document.TypeDetection");
                                       
        if (oInterface == null) {
            failed("Service wasn't created") ;
        }
View Full Code Here

        TestParameters tParam, PrintWriter log ) throws StatusException {
        XInterface oObj = null;
  log.println("creating test environment");
        try {
     
            XMultiServiceFactory xMSF = tParam.getMSF();
           
            Object xInterface = xMSF.createInstance( "com.sun.star.frame.Desktop" );
            XDesktop dtop = ( XDesktop )UnoRuntime.queryInterface( XDesktop.class,
                xInterface );

            XModel model = dtop.getCurrentFrame().getController().getModel();
            oObj  =
                (XInterface)xMSF.createInstanceWithArguments( "drafts.com.sun.star.script.framework.provider.FunctionProvider", new Object[]{ model } );
           
           
        } catch (com.sun.star.uno.Exception e) {
            throw new StatusException("Can't create object environment", e) ;
        }
View Full Code Here

TOP

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

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.