Examples of XTextViewCursorSupplier


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

        // retrieve the current component and access the controller
        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);
        // set the appropriate properties for character and paragraph style
View Full Code Here

Examples of com.sun.star.text.XTextViewCursorSupplier

   * @date 31.07.2007
   */
  public ITextRange getTextRange() throws Exception {
    XTextContent textContent = getXTextContent();
    textDocument.setSelection(new XInterfaceObjectSelection(textContent));
    XTextViewCursorSupplier xTextViewCursorSupplier = (XTextViewCursorSupplier) UnoRuntime
        .queryInterface(XTextViewCursorSupplier.class, textDocument
            .getXTextDocument().getCurrentController());
    xTextViewCursorSupplier.getViewCursor().goLeft((short) 1, false);
    return textDocument.getViewCursorService().getViewCursor()
        .getTextCursorFromEnd().getEnd();
  }
View Full Code Here

Examples of com.sun.star.text.XTextViewCursorSupplier

   * @author Andreas Br�ker
   */
  public IPage getPage(int index) throws TextException {
    try {
      XController xController = textDocument.getXTextDocument().getCurrentController();
      XTextViewCursorSupplier xTextViewCursorSupplier = (XTextViewCursorSupplier)UnoRuntime.queryInterface(XTextViewCursorSupplier.class, xController);
      XTextViewCursor textViewCursor = xTextViewCursorSupplier.getViewCursor();
      XPageCursor pageCursor = (XPageCursor)UnoRuntime.queryInterface(XPageCursor.class, textViewCursor);
      pageCursor.jumpToPage((short)index);
      pageCursor.jumpToStartOfPage();
      XTextRange pageStart = textViewCursor.getStart();  
      PagePosition startPagePosition = new PagePosition(textDocument, pageStart);      
View Full Code Here

Examples of com.sun.star.text.XTextViewCursorSupplier

          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();
          }
View Full Code Here

Examples of com.sun.star.text.XTextViewCursorSupplier

   *
   * @author Andreas Br�ker
   */
  public IViewCursor getViewCursor() {
    XController xController = textDocument.getXTextDocument().getCurrentController();
    XTextViewCursorSupplier xTextViewCursorSupplier = (XTextViewCursorSupplier)UnoRuntime.queryInterface(XTextViewCursorSupplier.class, xController);
    return new ViewCursor(textDocument, xTextViewCursorSupplier.getViewCursor());
  }
View Full Code Here

Examples of com.sun.star.text.XTextViewCursorSupplier

   */
  public IPage getPage(int index) throws TextException {
    try {
      XController xController = textDocument.getXTextDocument()
          .getCurrentController();
      XTextViewCursorSupplier xTextViewCursorSupplier = (XTextViewCursorSupplier) UnoRuntime
          .queryInterface(XTextViewCursorSupplier.class, xController);
      XTextViewCursor textViewCursor = xTextViewCursorSupplier
          .getViewCursor();
      XPageCursor pageCursor = (XPageCursor) UnoRuntime.queryInterface(
          XPageCursor.class, textViewCursor);
      pageCursor.jumpToPage((short) index);
      pageCursor.jumpToStartOfPage();
View Full Code Here

Examples of com.sun.star.text.XTextViewCursorSupplier

   * @author Andreas Br�ker
   */
  public IViewCursor getViewCursor() {
    XController xController = textDocument.getXTextDocument()
        .getCurrentController();
    XTextViewCursorSupplier xTextViewCursorSupplier = (XTextViewCursorSupplier) UnoRuntime
        .queryInterface(XTextViewCursorSupplier.class, xController);
    return new ViewCursor(textDocument, xTextViewCursorSupplier
        .getViewCursor());
  }
View Full Code Here

Examples of com.sun.star.text.XTextViewCursorSupplier

   * @date 31.07.2007
   */
  public ITextRange getTextRange() throws Exception {
    XTextContent textContent = getXTextContent();  
    textDocument.setSelection(new XInterfaceObjectSelection(textContent));
    XTextViewCursorSupplier xTextViewCursorSupplier =
      (XTextViewCursorSupplier)UnoRuntime.queryInterface(XTextViewCursorSupplier.class,
          textDocument.getXTextDocument().getCurrentController());
    xTextViewCursorSupplier.getViewCursor().goLeft((short)1,false);
    return textDocument.getViewCursorService().getViewCursor().getTextCursorFromEnd().getEnd();
  }
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.