Package com.sun.star.frame

Examples of com.sun.star.frame.XComponentLoader


        try {
            xRemoteServiceManager = this.getRemoteServiceManager(
                    "uno:socket,host=localhost,port=8100;urp;StarOffice.ServiceManager");
            Object desktop = xRemoteServiceManager.createInstanceWithContext(
                "com.sun.star.frame.Desktop", xRemoteContext);
            XComponentLoader xComponentLoader = (XComponentLoader)UnoRuntime.queryInterface(
                XComponentLoader.class, desktop);

            PropertyValue[] loadProps = new PropertyValue[0];
            XComponent xSpreadsheetComponent = xComponentLoader.loadComponentFromURL("private:factory/scalc", "_blank", 0, loadProps);
           
            XSpreadsheetDocument xSpreadsheetDocument = (XSpreadsheetDocument)UnoRuntime.queryInterface(
                XSpreadsheetDocument.class, xSpreadsheetComponent);

            XSpreadsheets xSpreadsheets = xSpreadsheetDocument.getSheets();
View Full Code Here


       
       
        //define variables
        XInterface oInterface;
        XDesktop oDesktop;
        XComponentLoader oCLoader;
        XTextDocument oDoc = null;
        XComponent aDoc = null;
       
        try {
           
            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/swriter";
            aDoc = oCLoader.loadComponentFromURL(doc, "_blank", 0, szEmptyArgs );
            oDoc = (XTextDocument) UnoRuntime.queryInterface(XTextDocument.class, aDoc);
           
        } // end of try
       
        catch(Exception e){
View Full Code Here

    protected XComponent newDocComponent(String docType) throws java.lang.Exception {
        String loadUrl = "private:factory/" + docType;
        xRemoteServiceManager = this.getRemoteServiceManager(unoUrl);
        Object desktop = xRemoteServiceManager.createInstanceWithContext(
            "com.sun.star.frame.Desktop", xRemoteContext);
        XComponentLoader xComponentLoader = (XComponentLoader)UnoRuntime.queryInterface(
            XComponentLoader.class, desktop);
        PropertyValue[] loadProps = new PropertyValue[0];
        return xComponentLoader.loadComponentFromURL(loadUrl, "_blank", 0, loadProps);
    }
View Full Code Here

    public void drawOrganigram() throws java.lang.Exception {
        xRemoteServiceManager = this.getRemoteServiceManager(
                "uno:socket,host=localhost,port=8100;urp;StarOffice.ServiceManager");
        Object desktop = xRemoteServiceManager.createInstanceWithContext(
            "com.sun.star.frame.Desktop", xRemoteContext);
        XComponentLoader xComponentLoader = (XComponentLoader)UnoRuntime.queryInterface(
            XComponentLoader.class, desktop);

        PropertyValue[] loadProps = new PropertyValue[0];
        XComponent xDrawComponent = xComponentLoader.loadComponentFromURL("private:factory/sdraw", "_blank", 0, loadProps);
           
        // get draw page by index
        com.sun.star.drawing.XDrawPagesSupplier xDrawPagesSupplier = (com.sun.star.drawing.XDrawPagesSupplier)UnoRuntime.queryInterface(
            com.sun.star.drawing.XDrawPagesSupplier.class, xDrawComponent );
        com.sun.star.drawing.XDrawPages xDrawPages = xDrawPagesSupplier.getDrawPages();
View Full Code Here

        try {
            System.out.println("create new text document");
            // start document init
            XInterface xInterface = (XInterface) xMSF.createInstance("com.sun.star.frame.Desktop");
           
            XComponentLoader xComponentLoader = (XComponentLoader) UnoRuntime.queryInterface(
                XComponentLoader.class, xInterface );
           
            PropertyValue[] xEmptyArgs = new PropertyValue[0];
            XComponent xComponent  = xComponentLoader.loadComponentFromURL( "private:factory/swriter", "_blank", 0, xEmptyArgs);
           
            XTextDocument xTextDocument = (XTextDocument) UnoRuntime.queryInterface(
                XTextDocument.class, xComponent );
            XText xText = xTextDocument.getText();
            createExampleData( xText );
View Full Code Here

  static public XComponent createDocument( XMultiServiceFactory xMultiServiceFactory,
    String sURL, String sTargetFrame, int nSearchFlags, PropertyValue[] aArgs )
      throws Exception
  {
    XComponent xComponent = null;
    XComponentLoader aLoader = (XComponentLoader)UnoRuntime.queryInterface(
      XComponentLoader.class,
        xMultiServiceFactory.createInstance( "com.sun.star.frame.Desktop" ) );

    xComponent = (XComponent)UnoRuntime.queryInterface( XComponent.class,
      aLoader.loadComponentFromURL(
        sURL, sTargetFrame, nSearchFlags, aArgs ) );
    if ( xComponent == null )
      throw new Exception( "could not create document: " + sURL );
    return xComponent;
  }
View Full Code Here

     
      /* A desktop environment contains tasks with one or more
         frames in which components can be loaded. Desktop is the
         environment for components which can instanciate within
         frames. */
      XComponentLoader xcomponentloader = ( XComponentLoader )
      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 XSet on the XMultiServiceFactory
      XSet xsetMultiComponentFactory = ( XSet ) UnoRuntime.queryInterface(
View Full Code Here

     
      /* A desktop environment contains tasks with one or more
         frames in which components can be loaded. Desktop is the
         environment for components which can instanciate within
         frames. */
      XComponentLoader xcomponentloader = ( XComponentLoader )
      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/swriter", "_blank", 0,
      new PropertyValue[0] );
     
      // Querying for the interface XTextDocument on the xcomponent
      XTextDocument xtextdocument = ( XTextDocument ) UnoRuntime.queryInterface(
View Full Code Here

           
            /* A desktop environment contains tasks with one or more
               frames in which components can be loaded. Desktop is the
               environment for components which can instanciate within
               frames. */
            XComponentLoader xcomponentloader = ( XComponentLoader )
            UnoRuntime.queryInterface( XComponentLoader.class,
            xmulticomponentfactory.createInstanceWithContext(
            "com.sun.star.frame.Desktop", xcomponentcontext ) );
           
            // Load the Calc document, which will be automaticly displayed
            XComponent xcomponent = xcomponentloader.loadComponentFromURL(
            args[ 1 ], "_blank", 0,
            new PropertyValue[0] );
           
            // Querying for the interface XSpreadsheetDocument on XComponent
            XSpreadsheetDocument xspreadsheetdocument = ( XSpreadsheetDocument )
View Full Code Here

     
      /* A desktop environment contains tasks with one or more
         frames in which components can be loaded. Desktop is the
         environment for components which can instanciate within
         frames. */
      XComponentLoader xcomponentloader = ( XComponentLoader )
      UnoRuntime.queryInterface( XComponentLoader.class,
      xmulticomponentfactory.createInstanceWithContext(
      "com.sun.star.frame.Desktop", xcomponentcontext ) );
     
      // Preparing properties for loading the document
      PropertyValue propertyvalue[] = new PropertyValue[ 1 ];
      // Setting the flag for hidding the open document
      propertyvalue[ 0 ] = new PropertyValue();
      propertyvalue[ 0 ].Name = "Hidden";
      propertyvalue[ 0 ].Value = new Boolean(true);
     
      // Loading the wanted document
      Object objectDocumentToStore =
      xcomponentloader.loadComponentFromURL(
      stringUrl, "_blank", 0, propertyvalue );
     
      // Getting an object that will offer a simple way to store a document to a URL.
      XStorable xstorable =
      ( XStorable ) UnoRuntime.queryInterface( XStorable.class,
View Full Code Here

TOP

Related Classes of com.sun.star.frame.XComponentLoader

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.