Package com.sun.star.sheet

Examples of com.sun.star.sheet.SingleReference


    }

    protected FormulaToken getRefToken(XCell xCell) {
        XCellAddressable xCellAddr =  (XCellAddressable)UnoRuntime.queryInterface(XCellAddressable.class, xCell);
        CellAddress addr = xCellAddr.getCellAddress();
        SingleReference ref = new SingleReference();
        ref.Column = addr.Column;
        ref.Row    = addr.Row;
        ref.Sheet  = addr.Sheet;
        ref.Flags = ReferenceFlags.SHEET_3D;
        FormulaToken token = new FormulaToken();
View Full Code Here


        FormulaToken token = tokens[0];

        if (SingleReference.class == token.Data.getClass()){

            SingleReference ref = (SingleReference)token.Data;
            m_xValidSheet = getSheetByIndex(ref.Sheet);
            if (m_xValidSheet == null)
                return false;
            m_selectedCellToken = new FormulaToken[1];
            m_selectedCellToken[0] = token;
View Full Code Here

    }

    @Override
    public String toString(){
       
        SingleReference formulaCellRef = (SingleReference)getGui().getController().getRefToken(m_xCell).Data;

        String itemValue = getGui().createStringWithSpace( getGui().getController().getCellName( m_xCell ).replace("$", ""), 24 );
        itemValue += getErrorMessage(); // get errorXXX original message, it independent even if the formula had been corrected

        if( m_ErrorType == 0 ) {
            itemValue += " - " + getGui().getDialogPropertyValue("Strings", "Strings.correctedLabel.Label");
        } else {
            if( m_ErrorType != 3 ){
                String sCells = "";
                String currCellName = "";
                if( m_lNotValidPrecCells != null ) {
                    for (XCell currXCell : m_lNotValidPrecCells){
                        SingleReference currCellRef = (SingleReference)getGui().getController().getRefToken(currXCell).Data;
                        currCellName = (currCellRef.Sheet == formulaCellRef.Sheet) ? "" : getGui().getController().getSheetNameByIndex(currCellRef.Sheet) + ".";
                        currCellName += getGui().getController().getCellName(currXCell).replace("$", "");
                        sCells += " " + currCellName;
                    }
                }
View Full Code Here

    }

    public String getMemberCellSheetName(){
        String sheetName = "";
        if(m_number == _selectedItemPos ) {
            SingleReference cellRef = (SingleReference)getGui().getController().getRefToken( m_xCell ).Data;
            cellRef.Flags = 128;
            String activeCellName = getGui().getController().getActiveSheetName();
            String currSheetName = getGui().getController().getSheetNameByIndex(cellRef.Sheet);
            sheetName = currSheetName.equals(activeCellName) ? "" : currSheetName + ".";
        }
View Full Code Here

        return parseFormula(tokens);
    }

    public String getCellName(XCell xCell) {
        FormulaToken formulaToken = getRefToken(xCell);
        SingleReference ref = (SingleReference)formulaToken.Data;
        // We don't want to display the sheet name, and the cell position should be absolute, not relative.
        ref.Flags = 0;
        FormulaToken[] tokens = { formulaToken };
        XFormulaParser xParser = getFormulaParser();
        XCellAddressable xCellAddr =  (XCellAddressable)UnoRuntime.queryInterface(XCellAddressable.class, xCell);
View Full Code Here

    }

    protected FormulaToken getRefToken(XCell xCell) {
        XCellAddressable xCellAddr =  (XCellAddressable)UnoRuntime.queryInterface(XCellAddressable.class, xCell);
        CellAddress addr = xCellAddr.getCellAddress();
        SingleReference ref = new SingleReference();
        ref.Column = addr.Column;
        ref.Row    = addr.Row;
        ref.Sheet  = addr.Sheet;
        ref.Flags = ReferenceFlags.SHEET_3D;
        FormulaToken token = new FormulaToken();
View Full Code Here

                address.EndColumn   = ref.Reference2.Column;
                address.EndRow      = ref.Reference2.Row;
                lAddresses.add( address );
            }
            if(tokens[i].Data.toString().startsWith("com.sun.star.sheet.SingleReference")){
                SingleReference ref = (SingleReference)tokens[i].Data;
                ref.Flags = 0;

                CellRangeAddress address = new CellRangeAddress();
                address.Sheet = (short)ref.Sheet;
                address.StartColumn = address.EndColumn = ref.Column;
View Full Code Here

        short num = 0;

        XNamed xNamed = (XNamed)UnoRuntime.queryInterface(XNamed.class, xValidSheet);
        String sheetName = xNamed.getName();

        SingleReference ref = (SingleReference)selectedCellToken.Data;
        ref.Flags = 0;
       
        CellAddress addr = new CellAddress();
        addr.Sheet = (short)ref.Sheet;
        addr.Column = (short)ref.Column;
View Full Code Here

    }
   
    public void init() throws IndexOutOfBoundsException {

        //m_xCell is the basic of WatchedCell objects. This won't be changed!
        SingleReference ref = (SingleReference) m_cellToken.Data;
        m_xCell = m_xSpreadsheet.getCellByPosition(ref.Column, ref.Row);

        setValue();
        setFormula();
View Full Code Here

        }
    }

    public void setCellName(){
        m_cellToken = getController().getRefToken(m_xCell);
        SingleReference ref = (SingleReference)m_cellToken.Data;
        // We don't want to display the sheet name, and the cell position should be absolute, not relative.
        ref.Flags = 0;
        FormulaToken[] tokens = { m_cellToken };
        XCellAddressable xCellAddr =  (XCellAddressable)UnoRuntime.queryInterface(XCellAddressable.class, m_xCell);
        CellAddress addr = xCellAddr.getCellAddress();
View Full Code Here

TOP

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

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.