Examples of XPageCursor


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

        xStyleFamiliesSupplier = (XStyleFamiliesSupplier) UnoRuntime.queryInterface(XStyleFamiliesSupplier.class, xTextDocument);
    }

    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

        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

            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

  Object oFirstTextTable;
  XTextContent xTextTable;
  BreakType BreakValue;
  xTextDocument = (XTextDocument) UnoRuntime.queryInterface(XTextDocument.class, xComponent);
  xViewCursorSupplier = (XTextViewCursorSupplier) UnoRuntime.queryInterface(XTextViewCursorSupplier.class, xTextDocument.getCurrentController())
  XPageCursor xPageCursor = (XPageCursor) UnoRuntime.queryInterface(XPageCursor.class, xViewCursorSupplier.getViewCursor());
  XTextCursor xViewTextCursor = (XTextCursor) UnoRuntime.queryInterface(XTextCursor.class,  xPageCursor);
  xPageCursor.jumpToFirstPage();
  xPageCursor.jumpToStartOfPage();
  Tools.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");
  if (xTextTablesSupplier.getTextTables().hasByName("Tbl_GroupField1"))
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

    {
        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

            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

  XTextRange xRange;
  XTextContent xTextTable;
  BreakType BreakValue;
  xTextDocument = (XTextDocument) UnoRuntime.queryInterface(XTextDocument.class, xComponent);
  xViewCursorSupplier = (XTextViewCursorSupplier) UnoRuntime.queryInterface(XTextViewCursorSupplier.class, xTextDocument.getCurrentController())
  XPageCursor xPageCursor = (XPageCursor) UnoRuntime.queryInterface(XPageCursor.class, xViewCursorSupplier.getViewCursor());
  XTextCursor xViewTextCursor = (XTextCursor) UnoRuntime.queryInterface(XTextCursor.class,  xPageCursor);
  xPageCursor.jumpToFirstPage();
  xPageCursor.jumpToStartOfPage();
  Tools.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, xTextTablesSupplier.getTextTables());
  int TextTablesCount = xAllTextTables.getCount();
  for (int i = 0; i<TextTablesCount; i++){
      xTextTable = (XTextContent) UnoRuntime.queryInterface(XTextContent.class, xAllTextTables.getByIndex(i));
      xRange = (XTextRange) UnoRuntime.queryInterface(XTextRange.class, xTextTable.getAnchor().getText());
      xViewTextCursor.gotoRange(xRange, false);
      if (xPageCursor.getPage() == (short)1){
    Tools.setUNOPropertyValue(xTextTable, "PageDescName", "First Page");
    resetBreakTypeofTextTable(xTextTable);
      }
  }
  XTextRange xHeaderRange = (XTextRange) Tools.getUNOPropertyValue(oPageStyle, "HeaderText", XTextRange.class);
View Full Code Here

Examples of com.sun.star.text.XPageCursor

  XTextRange xRange;
  XTextContent xTextTable;
  BreakType BreakValue;
  xTextDocument = (XTextDocument) UnoRuntime.queryInterface(XTextDocument.class, xComponent);
  xViewCursorSupplier = (XTextViewCursorSupplier) UnoRuntime.queryInterface(XTextViewCursorSupplier.class, xTextDocument.getCurrentController())
  XPageCursor xPageCursor = (XPageCursor) UnoRuntime.queryInterface(XPageCursor.class, xViewCursorSupplier.getViewCursor());
  XTextCursor xViewTextCursor = (XTextCursor) UnoRuntime.queryInterface(XTextCursor.class,  xPageCursor);
  xPageCursor.jumpToFirstPage();
  xPageCursor.jumpToStartOfPage();
  Tools.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, xTextTablesSupplier.getTextTables());
  int TextTablesCount = xAllTextTables.getCount();
  for (int i = 0; i<TextTablesCount; i++){
      xTextTable = (XTextContent) UnoRuntime.queryInterface(XTextContent.class, xAllTextTables.getByIndex(i));
      xRange = (XTextRange) UnoRuntime.queryInterface(XTextRange.class, xTextTable.getAnchor().getText());
      xViewTextCursor.gotoRange(xRange, false);
      if (xPageCursor.getPage() == (short)1){
    Tools.setUNOPropertyValue(xTextTable, "PageDescName", "First Page");
    resetBreakTypeofTextTable(xTextTable);
      }
  }
  XTextRange xHeaderRange = (XTextRange) Tools.getUNOPropertyValue(oPageStyle, "HeaderText", XTextRange.class);
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.