Examples of XPageCursor


Examples of com.sun.star.text.XPageCursor

            XPropertySet.class, xViewCursor);
        // set the appropriate properties for character and paragraph style
        xCursorPropertySet.setPropertyValue("CharStyleName", "Quotation");
        xCursorPropertySet.setPropertyValue("ParaStyleName", "Quotations");
        // print the current page number
        XPageCursor xPageCursor = (XPageCursor)UnoRuntime.queryInterface(
            XPageCursor.class, xViewCursor);
        System.out.println("The current page number is " + xPageCursor.getPage());
        // the model cursor is much more powerful, so
        // we create a model cursor at the current view cursor position with the
        // following steps:
        // get the Text service from the TextViewCursor, it is an XTextRange:
         XText xDocumentText = xViewCursor.getText();
View Full Code Here

Examples of com.sun.star.text.XPageCursor

            XPropertySet.class, xViewCursor);
        // set the appropriate properties for character and paragraph style
        xCursorPropertySet.setPropertyValue("CharStyleName", "Quotation");
        xCursorPropertySet.setPropertyValue("ParaStyleName", "Quotations");
        // print the current page number
        XPageCursor xPageCursor = (XPageCursor)UnoRuntime.queryInterface(
            XPageCursor.class, xViewCursor);
        System.out.println("The current page number is " + xPageCursor.getPage());
        // the model cursor is much more powerful, so
        // we create a model cursor at the current view cursor position with the
        // following steps:
        // get the Text service from the TextViewCursor, it is an XTextRange:
         XText xDocumentText = xViewCursor.getText();
View Full Code Here

Examples of com.sun.star.text.XPageCursor

    {
        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.XPageCursor

    public void selectFirstPage(TextTableHandler oTextTableHandler)
    {
        try
        {
            XPageCursor xPageCursor = (XPageCursor) UnoRuntime.queryInterface(XPageCursor.class, xTextViewCursorSupplier.getViewCursor());
            XTextCursor xViewTextCursor = (XTextCursor) UnoRuntime.queryInterface(XTextCursor.class, xPageCursor);
            xPageCursor.jumpToFirstPage();
            xPageCursor.jumpToStartOfPage();
            Helper.setUnoPropertyValue(xPageCursor, "PageDescName", "First Page");
            Object oPageStyles = xStyleFamiliesSupplier.getStyleFamilies().getByName("PageStyles");
            XNameAccess xName = (XNameAccess) UnoRuntime.queryInterface(XNameAccess.class, oPageStyles);
            Object oPageStyle = xName.getByName("First Page");
            XIndexAccess xAllTextTables = (XIndexAccess) UnoRuntime.queryInterface(XIndexAccess.class, oTextTableHandler.xTextTablesSupplier.getTextTables());
View Full Code Here

Examples of com.sun.star.text.XPageCursor

            XPropertySet.class, xViewCursor);
        // set the appropriate properties for character and paragraph style
        xCursorPropertySet.setPropertyValue("CharStyleName", "Quotation");
        xCursorPropertySet.setPropertyValue("ParaStyleName", "Quotations");
        // print the current page number
        XPageCursor xPageCursor = (XPageCursor)UnoRuntime.queryInterface(
            XPageCursor.class, xViewCursor);
        System.out.println("The current page number is " + xPageCursor.getPage());
        // the model cursor is much more powerful, so
        // we create a model cursor at the current view cursor position with the following steps:
        // get the Text service from the TextViewCursor, it is an XTextRange:
         XText xDocumentText = xViewCursor.getText();
        // create a model cursor from the viewcursor
View Full Code Here

Examples of com.sun.star.text.XPageCursor

   *
   * @author Markus Kr�ger
   */
  public IPageCursor getPageCursor() {
    if(pageCursor == null) {
      XPageCursor xPageCursor = (XPageCursor)UnoRuntime.queryInterface(XPageCursor.class, xTextViewCursor);
      if(xPageCursor != null) {
        pageCursor = new PageCursor(xPageCursor);
      }
    }
    return pageCursor;
View Full Code Here

Examples of com.sun.star.text.XPageCursor

  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);      
      pageCursor.jumpToEndOfPage();   
      XTextRange pageEnd = textViewCursor.getStart();
      PagePosition endPagePosition = new PagePosition(textDocument, pageEnd);
      return new Page(textDocument, startPagePosition, endPagePosition);
    }
    catch(Exception exception) {
View Full Code Here

Examples of com.sun.star.text.XPageCursor

   *
   * @author Markus Kr�ger
   */
  public IPageCursor getPageCursor() {
    if (pageCursor == null) {
      XPageCursor xPageCursor = (XPageCursor) UnoRuntime.queryInterface(
          XPageCursor.class, xTextViewCursor);
      if (xPageCursor != null) {
        pageCursor = new PageCursor(xPageCursor);
      }
    }
View Full Code Here

Examples of com.sun.star.text.XPageCursor

          .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);
      pageCursor.jumpToEndOfPage();
      XTextRange pageEnd = textViewCursor.getStart();
      PagePosition endPagePosition = new PagePosition(textDocument,
          pageEnd);
      return new Page(textDocument, startPagePosition, endPagePosition);
    } catch (Exception exception) {
View Full Code Here

Examples of com.sun.star.text.XPageCursor

            XPropertySet.class, xViewCursor);
        // set the appropriate properties for character and paragraph style
        xCursorPropertySet.setPropertyValue("CharStyleName", "Quotation");
        xCursorPropertySet.setPropertyValue("ParaStyleName", "Quotations");
        // print the current page number
        XPageCursor xPageCursor = (XPageCursor)UnoRuntime.queryInterface(
            XPageCursor.class, xViewCursor);
        System.out.println("The current page number is " + xPageCursor.getPage());
        // the model cursor is much more powerful, so
        // we create a model cursor at the current view cursor position with the
        // following steps:
        // get the Text service from the TextViewCursor, it is an XTextRange:
         XText xDocumentText = xViewCursor.getText();
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.