Package com.sun.star.table

Examples of com.sun.star.table.XCellRange


        try {
            oObj.autoFormat(name); // applying default format

            // getting current background of the cell
            XCellRange cellRange = (XCellRange) UnoRuntime.queryInterface(
                                           XCellRange.class, oObj);
            XCell oCell = cellRange.getCellByPosition(0, 0);
            XPropertySet PS = (XPropertySet) UnoRuntime.queryInterface(
                                      XPropertySet.class, oCell);
                            
            Integer bkgrnd1;
            try {
View Full Code Here


        }
    }

    public void _setTableOperation() {
        boolean res = true;
        XCellRange cellRange = oSheet.getCellRangeByName("$A$17:$A$17");
        XCellRangeAddressable CRA = (XCellRangeAddressable) UnoRuntime.queryInterface(
                                            XCellRangeAddressable.class,
                                            cellRange);
        XCell cell = null;
        XCell cell2 = null;
View Full Code Here

        // insert a chart

        Rectangle oRect = new Rectangle(500, 3000, 25000, 11000);

        XCellRange oRange = (XCellRange)
            UnoRuntime.queryInterface(XCellRange.class, oSheet);
        XCellRange myRange = oRange.getCellRangeByName("A1:N4");
        XCellRangeAddressable oRangeAddr = (XCellRangeAddressable)
            UnoRuntime.queryInterface(XCellRangeAddressable.class, myRange);
        CellRangeAddress myAddr = oRangeAddr.getRangeAddress();

        CellRangeAddress[] oAddr = new CellRangeAddress[1];
View Full Code Here

    */
    public void _createCursorByRange() {
        log.println("Testing createCursorByRange");

        log.println("getting cellrange");
        XCellRange oRange = null;
        try {
            oRange = oObj.getCellRangeByPosition (1, 1, 2, 3);
        } catch (com.sun.star.lang.IndexOutOfBoundsException e) {
            log.println("Can't get cell range by address");
            e.printStackTrace(log);
View Full Code Here

        docText.insertTextContent( cursor, textTable, false );
        ++expectedUndoActions; //FIXME this will create 2 actions! currently the event is sent for every individual action; should it be sent for top-level actions only? how many internal actions are created is an implementation detail!
        ++expectedUndoActions;

        // write some content into the center cell
        final XCellRange cellRange = UnoRuntime.queryInterface( XCellRange.class, textTable );
        final XCell centerCell = cellRange.getCellByPosition( 1, 1 );
        final XTextRange cellText = UnoRuntime.queryInterface( XTextRange.class, centerCell );
        cellText.setString( "Undo Manager API Test" );
        ++expectedUndoActions;

        // give it another color
View Full Code Here

        insertIntoCell(13,3,"=SUM(A4:L4)",oSheet,"");

        // insert a chart
        Rectangle oRect = new Rectangle(500, 3000, 25000, 11000);

        XCellRange oRange = (XCellRange)
            UnoRuntime.queryInterface(XCellRange.class, oSheet);
        XCellRange myRange = oRange.getCellRangeByName("A1:N4");
        XCellRangeAddressable oRangeAddr = (XCellRangeAddressable)
            UnoRuntime.queryInterface(XCellRangeAddressable.class, myRange);
        CellRangeAddress myAddr = oRangeAddr.getRangeAddress();

        CellRangeAddress[] oAddr = new CellRangeAddress[1];
View Full Code Here

        int height = addr.EndRow - addr.StartRow + 1 ;

        log.println( "Object area is ((" + leftCol + "," + topRow + "),(" +
            (leftCol + width - 1) + "," + (topRow + height - 1) + ")" );

        XCellRange new_range = null;
        try {
            // first we need to create an array formula
            new_range =
                oObj.getCellRangeByPosition(0, 0, 0, height - 1);
        } catch (com.sun.star.lang.IndexOutOfBoundsException e) {
            log.print("Get cell range by position failed: ");
            e.printStackTrace(log);
            tRes.tested("collapseToCurrentArray()", false);
        }

        log.println("DB: Successfully new range created");
        XArrayFormulaRange arrFormulaRange = (XArrayFormulaRange)
            UnoRuntime.queryInterface (XArrayFormulaRange.class, new_range);
        // write a simple formula (this array assigns another array)
        arrFormulaRange.setArrayFormula("A1:A" + height) ;

        // collapse cursor into one cell and then try to apply the method
        oObj.collapseToSize (1, 1) ;
        oObj.collapseToCurrentArray() ;

        // check the size of result range
        int cols = ( (XColumnRowRange)UnoRuntime.queryInterface(
                  XColumnRowRange.class, oObj) ).getColumns().getCount();
        int rows = ( (XColumnRowRange)UnoRuntime.queryInterface(
                  XColumnRowRange.class, oObj) ).getRows().getCount();

        if (cols == 1 && rows == height) {
            bResult = true;
        } else {
            bResult = false;
            log.println("The size of cell range must be 1x" + height +
                ", but after method call it was " + cols + "x" + rows);
        }

        // erase array formula
        arrFormulaRange.setArrayFormula("");

        // check if array formula has been cleared with last statement
        try {
            // if array formula isn't cleared exception is thrown
            new_range.getCellByPosition(0,0).setValue(111) ;
        } catch (com.sun.star.lang.IndexOutOfBoundsException e) {
            bResult = false ;
            log.println(
                "Array formula hasn't been cleared with setArrayFormula(\"\")");
            XSheetOperation clearRange = (XSheetOperation)
View Full Code Here

        log.println("DB: Starting collapseToMergedArea() method test ...") ;
        XSpreadsheet oSheet = oObj.getSpreadsheet() ;
        log.println ("DB: got Spreadsheet.") ;

        XCellRange newRange = null;
        try {
            newRange = oSheet.getCellRangeByPosition (
                leftCol + width - 1, topRow + height - 1,
                leftCol + width, topRow + height );
        } catch (com.sun.star.lang.IndexOutOfBoundsException e) {
View Full Code Here

                throw new StatusException("Couldn't create TextTable : "
                        + e.getMessage(), e);
            }
        }
        try {
            XCellRange the_Range = (XCellRange)
                    UnoRuntime.queryInterface(XCellRange.class, the_table);
            oObj = the_Range.getCellRangeByPosition(0, 0, 3, 4);
        } catch (com.sun.star.uno.Exception e) {
            e.printStackTrace( log );
            throw new StatusException("Couldn't get CellRange : "
                    + e.getMessage(), e);
        }
View Full Code Here

                Object range = oObj.getByName("Column" + i);
                XCellRangeReferrer CRR = (XCellRangeReferrer)UnoRuntime.
                                queryInterface(XCellRangeReferrer.class,range);

                XCellRange CR = CRR.getReferredCells();
                XCellRangeAddressable xCRA = (XCellRangeAddressable)
                    UnoRuntime.queryInterface(XCellRangeAddressable.class, CR);

                CellRangeAddress objCRA = xCRA.getRangeAddress();

                bResult &= (objCRA.EndColumn == i && objCRA.StartColumn == i);
                bResult &= objCRA.StartRow == 1;
                bResult &= objCRA.EndRow == 3;
                bResult &= objCRA.Sheet == 0;
            }

            border = Border.LEFT;
            oObj.addNewFromTitles(CRA, border);
            for (int i = 1; i < 4; i++) {
                bResult &= oObj.hasByName("Row" + i);

                Object range = oObj.getByName("Row" + i);
                XCellRangeReferrer CRR = (XCellRangeReferrer)UnoRuntime.
                                queryInterface(XCellRangeReferrer.class,range);

                XCellRange CR = CRR.getReferredCells();
                XCellRangeAddressable xCRA = (XCellRangeAddressable)
                    UnoRuntime.queryInterface(XCellRangeAddressable.class, CR);

                CellRangeAddress objCRA = xCRA.getRangeAddress();
View Full Code Here

TOP

Related Classes of com.sun.star.table.XCellRange

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.