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

        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

        // 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

  int iScaleLen = ScaleString.length();
  XTextCursor xTextCursor = createTextCursor(xTextDocument.getText());
  xTextCursor.gotoStart(false);
  Tools.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

  int iScaleLen = ScaleString.length();
  XTextCursor xTextCursor = createTextCursor(xTextDocument.getText());
  xTextCursor.gotoStart(false);
  Tools.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

    final XComponent xComponent = getXComponent();
    final Locale charLocale;
    final XPropertySet xCursorProps;
    try {
      final XModel model = UnoRuntime.queryInterface(XModel.class, xComponent);
      final XTextViewCursorSupplier xViewCursorSupplier =
          UnoRuntime.queryInterface(XTextViewCursorSupplier.class, model.getCurrentController());
      final XTextViewCursor xCursor = xViewCursorSupplier.getViewCursor();
      if (xCursor.isCollapsed()) { // no text selection
        xCursorProps = UnoRuntime.queryInterface(XPropertySet.class, xCursor);
      } else { // text is selected, need to create another cursor
        // as multiple languages can occur here - we care only
        // about character under the cursor, which might be wrong
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.