Package com.sun.star.sheet

Examples of com.sun.star.sheet.XSpreadsheetDocument


      XComponent xcomponent = xcomponentloader.loadComponentFromURL(
      "private:factory/scalc", "_blank", 0,
      new PropertyValue[0] );
     
      // Querying for the interface XSpreadsheetDocument
      XSpreadsheetDocument xspreadsheetdocument =
      ( XSpreadsheetDocument ) UnoRuntime.queryInterface(
      XSpreadsheetDocument.class, xcomponent );
     
      // Getting all sheets from the spreadsheet document.
      XSpreadsheets xspreadsheets = xspreadsheetdocument.getSheets() ;
     
      // Querying for the interface XIndexAccess.
      XIndexAccess xindexaccess = ( XIndexAccess ) UnoRuntime.queryInterface(
      XIndexAccess.class, xspreadsheets );
     
View Full Code Here


                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();
            xSpreadsheets.insertNewByName("MySheet", (short)0);
            com.sun.star.uno.Type elemType = xSpreadsheets.getElementType();
           
            System.out.println(elemType.getTypeName());
            Object sheet = xSpreadsheets.getByName("MySheet");
View Full Code Here

         */
        public void recalc( java.lang.Object aInstance )
            throws com.sun.star.uno.RuntimeException {
            try {
                // Querying for the interface XSpreadsheetDocument
                XSpreadsheetDocument xspreadsheetdocument =
                    ( XSpreadsheetDocument ) UnoRuntime.queryInterface(
                        XSpreadsheetDocument.class, aInstance );
               
                // Querying for the interface XIndexAccess
                XIndexAccess xindexaccess = ( XIndexAccess )
                    UnoRuntime.queryInterface( XIndexAccess.class,
                                               xspreadsheetdocument.getSheets() );
               
                // Getting the first XSpreadsheet
                XSpreadsheet xspreadsheet = (XSpreadsheet)UnoRuntime.queryInterface(
                    XSpreadsheet.class, xindexaccess.getByIndex( 0 ));
               
View Full Code Here

    protected void useCalc() throws java.lang.Exception {
        try {
            // create new calc document and manipulate cell text
            XComponent xCalcComponent = newDocComponent("scalc");
            XSpreadsheetDocument  xSpreadsheetDocument  =
                (XSpreadsheetDocument)UnoRuntime.queryInterface(
                    XSpreadsheetDocument .class, xCalcComponent);
            Object sheets = xSpreadsheetDocument.getSheets();
            XIndexAccess xIndexedSheets = (XIndexAccess)UnoRuntime.queryInterface(
                XIndexAccess.class, sheets);
            Object sheet =  xIndexedSheets.getByIndex(0);

            //get cell A2 in first sheet
View Full Code Here

            XComponent xcomponent = xcomponentloader.loadComponentFromURL(
            args[ 1 ], "_blank", 0,
            new PropertyValue[0] );
           
            // 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 );
View Full Code Here

            XComponent xcomponent = xcomponentloader.loadComponentFromURL(
            "file:///" + stringFileName, "_blank", 0,
            new PropertyValue[0] );
           
            // Query for the interface XSpreadsheetDocument
            XSpreadsheetDocument xspreadsheetdocument = ( XSpreadsheetDocument )
                UnoRuntime.queryInterface( XSpreadsheetDocument.class, xcomponent );
           
            XSpreadsheets xspreadsheets = xspreadsheetdocument.getSheets() ;
           
            XIndexAccess xindexaccess = (XIndexAccess)
                UnoRuntime.queryInterface(XIndexAccess.class, xspreadsheets );
           
            XSpreadsheet xspreadsheet = (XSpreadsheet) UnoRuntime.queryInterface(
View Full Code Here

            XComponent xcomponent = xcomponentloader.loadComponentFromURL(
            "private:factory/scalc", "_blank", 0,
            new PropertyValue[0] );
           
            // Query for the interface XSpreadsheetDocument
            XSpreadsheetDocument xspreadsheetdocument = ( XSpreadsheetDocument )
                UnoRuntime.queryInterface( XSpreadsheetDocument.class, xcomponent );
           
            // Get all sheets of the spreadsheet document.
            XSpreadsheets xspreadsheets = xspreadsheetdocument.getSheets() ;
           
            // Get the index of the spreadsheet document.
            XIndexAccess xindexaccess = (XIndexAccess) UnoRuntime.queryInterface(
                XIndexAccess.class, xspreadsheets );
           
View Full Code Here

            XComponent xComponent = xComponentloader.loadComponentFromURL(
            "file:///" + stringFileName, "_blank", 0,
            new PropertyValue[0] );
           
            // Query for the interface XSpreadsheetDocument
            XSpreadsheetDocument xSpreadSheetDocument = ( XSpreadsheetDocument )
                UnoRuntime.queryInterface( XSpreadsheetDocument.class, xComponent );
           
            XSpreadsheets xSpreadsheets = xSpreadSheetDocument.getSheets() ;
           
            XIndexAccess xIndexAccess = (XIndexAccess)
                UnoRuntime.queryInterface(XIndexAccess.class, xSpreadsheets );
           
            XSpreadsheet xSpreadsheet = (XSpreadsheet) UnoRuntime.queryInterface(
View Full Code Here

            XComponent xComponent = xcomponentloader.loadComponentFromURL(
            "private:factory/scalc", "_blank", 0,
            new PropertyValue[0] );
           
            // Query for the interface XSpreadsheetDocument
            XSpreadsheetDocument xspreadsheetdocument = ( XSpreadsheetDocument )
                UnoRuntime.queryInterface( XSpreadsheetDocument.class, xComponent );
           
            // Get all sheets of the spreadsheet document.
            XSpreadsheets xspreadsheets = xspreadsheetdocument.getSheets() ;
           
            // Get the index of the spreadsheet document.
            XIndexAccess xindexaccess = (XIndexAccess) UnoRuntime.queryInterface(
                XIndexAccess.class, xspreadsheets );
           
View Full Code Here

    void activateSheet( int sheetIndex )
    {
        try
        {
            // get the sheet to activate
            XSpreadsheetDocument doc = UnoRuntime.queryInterface( XSpreadsheetDocument.class, getDocument().getDocument() );
            XIndexAccess sheets = UnoRuntime.queryInterface( XIndexAccess.class, doc.getSheets() );

            XSpreadsheet sheet = UnoRuntime.queryInterface( XSpreadsheet.class, sheets.getByIndex( sheetIndex ) );

            // activate
            XSpreadsheetView view = UnoRuntime.queryInterface( XSpreadsheetView.class, getController() );
View Full Code Here

TOP

Related Classes of com.sun.star.sheet.XSpreadsheetDocument

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.