Package com.sun.star.frame

Examples of com.sun.star.frame.XComponentLoader.loadComponentFromURL()


        XComponentLoader aLoader = (XComponentLoader)
            UnoRuntime.queryInterface(
                XComponentLoader.class,
                mxMSFactory.createInstance( "com.sun.star.frame.Desktop" ) );

        XComponent xComponent = aLoader.loadComponentFromURL(
            "private:factory/scalc", "_blank", 0, new com.sun.star.beans.PropertyValue[0] );

        return (com.sun.star.sheet.XSpreadsheetDocument)
            UnoRuntime.queryInterface( com.sun.star.sheet.XSpreadsheetDocument.class, xComponent );
    }
View Full Code Here


            oInterface = (XInterface) oMSF.createInstance( "com.sun.star.frame.Desktop" );
            oDesktop = ( XDesktop ) UnoRuntime.queryInterface( XDesktop.class, oInterface );
            oCLoader = ( XComponentLoader ) UnoRuntime.queryInterface( XComponentLoader.class, oDesktop );
            PropertyValue [] szEmptyArgs = new PropertyValue [0];
            String doc = "private:factory/sdraw";
            aDoc = oCLoader.loadComponentFromURL(doc, "_blank", 0, szEmptyArgs );
           
        } // end of try
       
        catch(Exception e){
           
View Full Code Here

      PropertyValue[] propertyvalue = new PropertyValue[ 1 ];
      propertyvalue[ 0 ] = new PropertyValue();
      propertyvalue[ 0 ].Name = "Hidden";
      propertyvalue[ 0 ].Value = new Boolean(true);
     
      Object objectDocumentToStore = xcomponentloader.loadComponentFromURL(
      sLoadUrl.toString(), "_blank", 0, propertyvalue );
      XStorable xstorable =
      ( XStorable ) UnoRuntime.queryInterface( XStorable.class,
      objectDocumentToStore );
View Full Code Here

                XComponentLoader.class,
                maMSFactory.createInstance( "com.sun.star.frame.Desktop" ) );

            maSpreadsheetDoc = (XSpreadsheetDocument) UnoRuntime.queryInterface(
                XSpreadsheetDocument.class,
                aLoader.loadComponentFromURL( "private:factory/scalc",
                                              "_blank",
                                              0,
                                              new PropertyValue[ 0 ] ) );

            bOk = initSpreadsheet();
View Full Code Here

      UnoRuntime.queryInterface( XComponentLoader.class,
      xmulticomponentfactory.createInstanceWithContext(
      "com.sun.star.frame.Desktop", xcomponentcontext ) );
     
      // Load a Writer document, which will be automaticly displayed
      XComponent xcomponent = xcomponentloader.loadComponentFromURL(
      "private:factory/scalc", "_blank", 0,
      new PropertyValue[0] );
     
      // Querying for the interface XSpreadsheetDocument
      XSpreadsheetDocument xspreadsheetdocument =
View Full Code Here

          sTmp.append(sourceFile.getCanonicalPath().replace('\\', '/'));
          sUrl = sTmp.toString();
      }   
     
      // Load a Writer document, which will be automaticly displayed
      XComponent xcomponent = xcomponentloader.loadComponentFromURL(
      sUrl, "_blank", 0,
      new PropertyValue[0] );
     
      System.exit(0);
    }
View Full Code Here

      java.io.File sourceFile = new java.io.File(args[1]);
      StringBuffer sUrl = new StringBuffer("file:///");
      sUrl.append(sourceFile.getCanonicalPath().replace('\\', '/'));
     
      // Load a Writer document, which will be automaticly displayed
      XComponent xcomponent = xcomponentloader.loadComponentFromURL(
      sUrl.toString(), "_blank", 0,
      new PropertyValue[0] );
     
      // Querying for the interface XPrintable on the loaded document
      XPrintable xprintable =
View Full Code Here

        java.io.File sourceFile = new java.io.File("PrintDemo.sxw");
        StringBuffer sLoadFileUrl = new StringBuffer("file:///");
        sLoadFileUrl.append(sourceFile.getCanonicalPath().replace('\\', '/'));
       
        XComponent xDoc = xComponentLoader.loadComponentFromURL(sLoadFileUrl.toString(), "_blank",
                                                                0, loadProps);

        if ( xDoc != null ) {
            sourceFile = new java.io.File("somepopularfileformat.doc");
            StringBuffer sStoreFileUrl = new StringBuffer("file:///");
View Full Code Here

        Object desktop = mxRemoteServiceManager.createInstanceWithContext(
            "com.sun.star.frame.Desktop", mxRemoteContext);
        XComponentLoader xComponentLoader = (XComponentLoader)UnoRuntime.queryInterface(
            XComponentLoader.class, desktop);
        PropertyValue[] loadProps = new PropertyValue[0];
        return xComponentLoader.loadComponentFromURL(loadUrl, "_blank", 0, loadProps);   
    }
   
    /** Load a document as template
     */
    protected XComponent newDocComponentFromTemplate(String loadUrl) throws java.lang.Exception {
View Full Code Here

        PropertyValue[] loadProps = new PropertyValue[1];
        loadProps[0] = new PropertyValue();
        loadProps[0].Name = "AsTemplate";
        loadProps[0].Value = new Boolean(true);      
        // load
        return xComponentLoader.loadComponentFromURL(loadUrl, "_blank", 0, loadProps);          
    }

    /** Load a document with arguments (text purposes)
     */
    protected void storeDocComponent(XComponent xDoc, String storeUrl) throws java.lang.Exception {
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.