Examples of XTextViewCursorSupplier


Examples of com.sun.star.text.XTextViewCursorSupplier

        ITextTableCell textRangeToCompareCell = textRangeToCompare.getCell();
        if(thisCompareRangeCell != null && textRangeToCompareCell == null) {
          XTextContent textTable = thisCompareRangeCell.getTextTable().getXTextContent();  
          XSelectionSupplier selectionSupplier = (XSelectionSupplier)UnoRuntime.queryInterface(XSelectionSupplier.class, textDocument.getXTextDocument().getCurrentController());
          selectionSupplier.select(textTable);
          XTextViewCursorSupplier xTextViewCursorSupplier = (XTextViewCursorSupplier)UnoRuntime.queryInterface(XTextViewCursorSupplier.class, textDocument.getXTextDocument().getCurrentController());
          xTextViewCursorSupplier.getViewCursor().goLeft((short)1,false);
          thisCompareRange = textDocument.getViewCursorService().getViewCursor().getTextCursorFromEnd().getEnd();
        }
        else if(textRangeToCompareCell != null && thisCompareRangeCell == null) {
          XTextContent textTable = textRangeToCompareCell.getTextTable().getXTextContent();  
          XSelectionSupplier selectionSupplier = (XSelectionSupplier)UnoRuntime.queryInterface(XSelectionSupplier.class, textDocument.getXTextDocument().getCurrentController());
          selectionSupplier.select(textTable);
          XTextViewCursorSupplier xTextViewCursorSupplier = (XTextViewCursorSupplier)UnoRuntime.queryInterface(XTextViewCursorSupplier.class, textDocument.getXTextDocument().getCurrentController());
          xTextViewCursorSupplier.getViewCursor().goLeft((short)1,false);
          textRangeToCompare = textDocument.getViewCursorService().getViewCursor().getTextCursorFromEnd().getEnd();
        }
        else if(thisCompareRangeCell != null && textRangeToCompareCell != null) {
          XTextContent thisCompareRangeTable = thisCompareRangeCell.getTextTable().getXTextContent();
          XTextContent textRangeToCompareTable = textRangeToCompareCell.getTextTable().getXTextContent();
          boolean sameTable = UnoRuntime.areSame(
              thisCompareRangeTable,textRangeToCompareTable);
          if(sameTable) {
            ITextTableCellName thisCompareRangeCellName = thisCompareRangeCell.getName();
            ITextTableCellName textRangeToCompareCellName = textRangeToCompareCell.getName();
            int thisCompareRangeCellRow = thisCompareRangeCellName.getRowIndex();
            int thisCompareRangeCellCol = thisCompareRangeCellName.getColumnIndex();
            int textRangeToCompareCellRow = textRangeToCompareCellName.getRowIndex();
            int textRangeToCompareCellCol = textRangeToCompareCellName.getColumnIndex();
            if(thisCompareRangeCellRow < textRangeToCompareCellRow)
              return 1;
            else if(thisCompareRangeCellRow > textRangeToCompareCellRow)
              return -1;
            else {
              if(thisCompareRangeCellCol < textRangeToCompareCellCol)
                return 1;
              else if(thisCompareRangeCellCol > textRangeToCompareCellCol)
                return -1;
            }
          }
          else {
            XSelectionSupplier selectionSupplier = (XSelectionSupplier)UnoRuntime.queryInterface(XSelectionSupplier.class, textDocument.getXTextDocument().getCurrentController());
            selectionSupplier.select(thisCompareRangeTable);
            XTextViewCursorSupplier xTextViewCursorSupplier = (XTextViewCursorSupplier)UnoRuntime.queryInterface(XTextViewCursorSupplier.class, textDocument.getXTextDocument().getCurrentController());
            xTextViewCursorSupplier.getViewCursor().goLeft((short)1,false);
            thisCompareRange = textDocument.getViewCursorService().getViewCursor().getTextCursorFromEnd().getEnd();
            
            selectionSupplier = (XSelectionSupplier)UnoRuntime.queryInterface(XSelectionSupplier.class, textDocument.getXTextDocument().getCurrentController());
            selectionSupplier.select(textRangeToCompareTable);
            xTextViewCursorSupplier = (XTextViewCursorSupplier)UnoRuntime.queryInterface(XTextViewCursorSupplier.class, textDocument.getXTextDocument().getCurrentController());
            xTextViewCursorSupplier.getViewCursor().goLeft((short)1,false);
            textRangeToCompare = textDocument.getViewCursorService().getViewCursor().getTextCursorFromEnd().getEnd();
          }
        }
      }
      XText text = thisCompareRange.getXTextRange().getText();   
View Full Code Here

Examples of com.sun.star.text.XTextViewCursorSupplier

        XComponent xCurrentComponent = xDesktop.getCurrentComponent();
        XModel xModel = (XModel)UnoRuntime.queryInterface(XModel.class,
                                                          xCurrentComponent);
        XController xController = xModel.getCurrentController();
        // the controller gives us the TextViewCursor
        XTextViewCursorSupplier xViewCursorSupplier =
            (XTextViewCursorSupplier)UnoRuntime.queryInterface(
                XTextViewCursorSupplier.class, xController);
        XTextViewCursor xViewCursor = xViewCursorSupplier.getViewCursor();
       
        // query its XPropertySet interface, we want to set character and paragraph
        // properties
        XPropertySet xCursorPropertySet = (XPropertySet)UnoRuntime.queryInterface(
            XPropertySet.class, xViewCursor);
View Full Code Here

Examples of com.sun.star.text.XTextViewCursorSupplier

        int iScaleLen = ScaleString.length();
        com.sun.star.text.XTextCursor xTextCursor = createTextCursor(xTextDocument.getText());
        xTextCursor.gotoStart(false);
        com.sun.star.wizards.common.Helper.setUnoPropertyValue(xTextCursor, "PageDescName", "First Page");
        xTextCursor.setString(ScaleString);
        XTextViewCursorSupplier xViewCursor = (XTextViewCursorSupplier) UnoRuntime.queryInterface(XTextViewCursorSupplier.class, xTextDocument.getCurrentController());
        XTextViewCursor xTextViewCursor = xViewCursor.getViewCursor();
        xTextViewCursor.gotoStart(false);
        int iFirstPos = xTextViewCursor.getPosition().X;
        xTextViewCursor.gotoEnd(false);
        int iLastPos = xTextViewCursor.getPosition().X;
        iScale = (iLastPos - iFirstPos) / iScaleLen;
View Full Code Here

Examples of com.sun.star.text.XTextViewCursorSupplier

     */
    public static int getPageCount(Object model)
    {
        XModel xModel = (XModel) UnoRuntime.queryInterface(XModel.class, model);
        XController xController = xModel.getCurrentController();
        XTextViewCursorSupplier xTextVCS = (XTextViewCursorSupplier) UnoRuntime.queryInterface(XTextViewCursorSupplier.class, xController);
        XTextViewCursor xTextVC = xTextVCS.getViewCursor();
        XPageCursor xPC = (XPageCursor) UnoRuntime.queryInterface(XPageCursor.class, xTextVC);
        xPC.jumpToLastPage();
        return xPC.getPage();
    }
View Full Code Here

Examples of com.sun.star.text.XTextViewCursorSupplier

        int iScaleLen = ScaleString.length();
        com.sun.star.text.XTextCursor xTextCursor = createTextCursor(xTextDocument.getText());
        xTextCursor.gotoStart(false);
        com.sun.star.wizards.common.Helper.setUnoPropertyValue(xTextCursor, "PageDescName", "First Page");
        xTextCursor.setString(ScaleString);
        XTextViewCursorSupplier xViewCursor = (XTextViewCursorSupplier) UnoRuntime.queryInterface(XTextViewCursorSupplier.class, xTextDocument.getCurrentController());
        XTextViewCursor xTextViewCursor = xViewCursor.getViewCursor();
        xTextViewCursor.gotoStart(false);
        int iFirstPos = xTextViewCursor.getPosition().X;
        xTextViewCursor.gotoEnd(false);
        int iLastPos = xTextViewCursor.getPosition().X;
        iScale = (iLastPos - iFirstPos) / iScaleLen;
View Full Code Here

Examples of com.sun.star.text.XTextViewCursorSupplier

     * @return the page count of the document.
     */
    public static int getPageCount(Object model) {
        XModel xModel = (XModel)UnoRuntime.queryInterface(XModel.class, model);
        XController xController = xModel.getCurrentController();
        XTextViewCursorSupplier xTextVCS = (XTextViewCursorSupplier)
            UnoRuntime.queryInterface(XTextViewCursorSupplier.class,xController);
        XTextViewCursor xTextVC = xTextVCS.getViewCursor();
        XPageCursor xPC = (XPageCursor) UnoRuntime.queryInterface(XPageCursor.class,xTextVC);
        xPC.jumpToLastPage();
        return xPC.getPage();
    }
View Full Code Here

Examples of com.sun.star.text.XTextViewCursorSupplier

        XComponent xCurrentComponent = xDesktop.getCurrentComponent();
        XModel xModel = (XModel)UnoRuntime.queryInterface(XModel.class,
                                                          xCurrentComponent);
        XController xController = xModel.getCurrentController();
        // the controller gives us the TextViewCursor
        XTextViewCursorSupplier xViewCursorSupplier =
            (XTextViewCursorSupplier)UnoRuntime.queryInterface(
                XTextViewCursorSupplier.class, xController);
        XTextViewCursor xViewCursor = xViewCursorSupplier.getViewCursor();
       
        // query its XPropertySet interface, we want to set character and paragraph
        // properties
        XPropertySet xCursorPropertySet = (XPropertySet)UnoRuntime.queryInterface(
            XPropertySet.class, xViewCursor);
View Full Code Here

Examples of com.sun.star.text.XTextViewCursorSupplier

        log.println( "creating a test environment" );

        // create testobject here
        oObj = xTextDoc.getCurrentController();

        XTextViewCursorSupplier oTVCSupp = (XTextViewCursorSupplier)
            UnoRuntime.queryInterface(XTextViewCursorSupplier.class, oObj);

        oObj = oTVCSupp.getViewCursor();

        log.println( "creating a new environment for TextViewCursor object" );
        TestEnvironment tEnv = new TestEnvironment( oObj );

        log.println( "adding TextDocument as mod relation to environment" );
View Full Code Here

Examples of com.sun.star.text.XTextViewCursorSupplier

      XSelectionSupplier xSelection = (XSelectionSupplier) UnoRuntime.queryInterface(XSelectionSupplier.class, xTextDocument.getCurrentController());
      xSelection.select(xLocCellRange);
      Tools.dispatchURL(xMSF, ".uno:DistributeColumns", xFrame);
      Tools.dispatchURL(xMSF, ".uno:SetOptimalColumnWidth", xFrame);
      Tools.setUNOPropertyValue(xTextTable, "HoriOrient", new Short(iHoriOrient));
      XTextViewCursorSupplier xViewCursor = (XTextViewCursorSupplier) UnoRuntime.queryInterface(XTextViewCursorSupplier.class, xTextDocument.getCurrentController());
      XTextViewCursor xTextViewCursor = xViewCursor.getViewCursor();
      xTextViewCursor.collapseToStart();
  }
  catch( com.sun.star.uno.Exception exception ){
      exception.printStackTrace(System.out);
  }}
View Full Code Here

Examples of com.sun.star.text.XTextViewCursorSupplier

      XSelectionSupplier xSelection = (XSelectionSupplier) UnoRuntime.queryInterface(XSelectionSupplier.class, xTextDocument.getCurrentController());
      xSelection.select(xLocCellRange);
      Tools.dispatchURL(xMSF, ".uno:DistributeColumns", xFrame);
      Tools.dispatchURL(xMSF, ".uno:SetOptimalColumnWidth", xFrame);
      Tools.setUNOPropertyValue(xTextTable, "HoriOrient", new Short(iHoriOrient));
      XTextViewCursorSupplier xViewCursor = (XTextViewCursorSupplier) UnoRuntime.queryInterface(XTextViewCursorSupplier.class, xTextDocument.getCurrentController());
      XTextViewCursor xTextViewCursor = xViewCursor.getViewCursor();
      xTextViewCursor.collapseToStart();
  }
  catch( com.sun.star.uno.Exception exception ){
      exception.printStackTrace(System.out);
  }}
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.