Package com.sun.star.sheet

Examples of com.sun.star.sheet.XSpreadsheetDocument


        // first we write what we are intend to do to log file
        log.println( "Creating a test environment" );

        log.println("Getting test object ") ;

        XSpreadsheetDocument xSpreadsheetDoc = (XSpreadsheetDocument)
            UnoRuntime.queryInterface(XSpreadsheetDocument.class, xSheetDoc);
        XSpreadsheets sheets = (XSpreadsheets) xSpreadsheetDoc.getSheets();

        XNameAccess oNames = (XNameAccess)
            UnoRuntime.queryInterface( XNameAccess.class, sheets );
        XCell oCell = null;
        XSpreadsheet oSheet  = null;
View Full Code Here


     * @see com.sun.star.awt.XKeyHandler
     * @see com.sun.star.awt.XMouseClickHandler
     */
    public void checkCalcDocument(){
       
        XSpreadsheetDocument xDoc = null;
       
        try{
            xDoc = m_SOF.createCalcDoc("CalcTest");
        } catch (com.sun.star.uno.Exception e){
            failed("Could not create a calc document: " +e.toString());
View Full Code Here

        CellAddress cellPos = new CellAddress((short)0, 1, 2);

        try {
            log.println("Getting test object ") ;

            XSpreadsheetDocument xArea = (XSpreadsheetDocument)
                UnoRuntime.queryInterface(XSpreadsheetDocument.class, xSheetDoc);

            XSpreadsheets oSheets = (XSpreadsheets) xArea.getSheets();

            XIndexAccess XAccess = (XIndexAccess)
                        UnoRuntime.queryInterface(XIndexAccess.class, oSheets);

            XSpreadsheet oSheet = (XSpreadsheet)XAccess.getByIndex(cellPos.Sheet);
View Full Code Here

    protected void initialize( TestParameters tParam, PrintWriter log ) {
        SOfficeFactory SOF = SOfficeFactory.getFactory( (XMultiServiceFactory)tParam.getMSF() );

        try {
            log.println( "creating a Spreadsheet document" );
            XSpreadsheetDocument xSpreadsheetDoc = SOF.createCalcDoc( null );
            xSheetDoc = (XComponent) UnoRuntime.queryInterface
                (XComponent.class, xSpreadsheetDoc);
        } catch ( com.sun.star.uno.Exception e ) {
            // Some exception occures.FAILED
            e.printStackTrace( log );
View Full Code Here

            {"end", "office:document"}} ;

        tEnv.addObjRelation("XDocumentHandler.XMLData", xml) ;

        final PrintWriter fLog = log ;
        XSpreadsheetDocument xSpreadsheetDoc = (XSpreadsheetDocument)
            UnoRuntime.queryInterface(XSpreadsheetDocument.class, xSheetDoc);
        final XSpreadsheets sheets = xSpreadsheetDoc.getSheets() ;
        log.println("Sheets before importing :") ;
        String[] names = sheets.getElementNames() ;
        for (int i = 0; i < names.length; i++) {
            log.println("  " + names[i]) ;
        }
View Full Code Here

    /* ------------------------------------------------------------------ */
    /** returns the sheets collection
    */
    public XSpreadsheets getSheets() throws com.sun.star.uno.Exception
    {
        XSpreadsheetDocument spreadsheetDoc = (XSpreadsheetDocument)UnoRuntime.queryInterface( XSpreadsheetDocument.class,
            getDocument()
        );
        return spreadsheetDoc.getSheets();
    }
View Full Code Here

                                                                 xDrawDoc));
    }
   
    private void makeCalcDoc(String frameName, boolean withContent){
        log.println("creating Calc document '" + frameName + "'");
        XSpreadsheetDocument xSpreadsheetDoc = createNewCalcDoc(frameName);
        if (withContent) fillCalcDocWithContent(xSpreadsheetDoc);
        positioningDocument((XModel) UnoRuntime.queryInterface(XModel.class,
                                                           xSpreadsheetDoc));
    }
View Full Code Here

        }
    }
   
    private XSpreadsheetDocument createNewCalcDoc(String frameName){
       
        XSpreadsheetDocument xSheetDoc = null;
       
        try {
            xSheetDoc = SOF.createCalcDoc(frameName);
        } catch (com.sun.star.uno.Exception e) {
            log.println("Exception occured while creating calc document '"+frameName+"':");
View Full Code Here

        super( xCtx, document );
    }

    public XCellRange getSheet( int index ) throws com.sun.star.uno.Exception
    {
        XSpreadsheetDocument spreadsheetDoc = (XSpreadsheetDocument)UnoRuntime.queryInterface( XSpreadsheetDocument.class,
            m_documentComponent
        );
        XIndexAccess sheets = (XIndexAccess)UnoRuntime.queryInterface( XIndexAccess.class,
            spreadsheetDoc.getSheets()
        );
        return (XCellRange)UnoRuntime.queryInterface( XCellRange.class,
            sheets.getByIndex( index )
        );
    }
View Full Code Here

            XExporter xEx = (XExporter) UnoRuntime.queryInterface
                (XExporter.class,oObj);
            xEx.setSourceDocument(xSheetDoc);

            //set name of sheet
            XSpreadsheetDocument xSpreadsheetDoc = (XSpreadsheetDocument)
                UnoRuntime.queryInterface(XSpreadsheetDocument.class, xSheetDoc);
            XSpreadsheets xSpreadsheets = xSpreadsheetDoc.getSheets();
            XIndexAccess xSheetsIndexArray = (XIndexAccess)
                UnoRuntime.queryInterface(XIndexAccess.class, xSpreadsheets);
            XSpreadsheet xSheet = (XSpreadsheet) AnyConverter.toObject(
                    new Type(XSpreadsheet.class),xSheetsIndexArray.getByIndex(0));
            XNamed xSheetNamed = (XNamed)
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.