Package com.sun.star.text

Examples of com.sun.star.text.XTextCursor.gotoEnd()


                xText.insertControlCharacter(xTextCursor, ControlCharacter.PARAGRAPH_BREAK, false);
                //    Helper.setUnoPropertyValue(xTextCursor, "PageDescName", "First Page");
                xTextCursor.collapseToEnd();
            }
            XTextCursor xSecondTextCursor = xText.createTextCursor();
            xSecondTextCursor.gotoEnd(false);
            insertTextSection(GroupName, TemplateName, xSecondTextCursor);
        }
        catch (IllegalArgumentException e)
        {
            e.printStackTrace(System.out);
View Full Code Here


            public void setPrintWriter(PrintWriter log) {
                out = log;
            }

            public void prepareToSort() {
                textCursor.gotoEnd(false);

                try {
                    aText.insertControlCharacter(textCursor,
                                                 ControlCharacter.PARAGRAPH_BREAK,
                                                 false);
View Full Code Here

  }
  else{
      xTextSection =  (XInterface) xMSFDoc.createInstance("com.sun.star.text.TextSection");
      XTextContent xTextContentSection = (XTextContent) UnoRuntime.queryInterface(XTextContent.class, xTextSection);
      XTextCursor xTextCursor = createTextCursor(xTextDocument.getText());
      xTextCursor.gotoEnd(false);
      xTextCursor.getText().insertTextContent(xTextCursor, xTextContentSection, false);
  }
  linkSectiontoTemplate(xTextSection, TemplateName, GroupName);
    }
    catch( com.sun.star.uno.Exception exception ){
View Full Code Here

  int iFirstPos = xTextViewCursor.getPosition().X;
  xTextViewCursor.gotoEnd(false);
  int iLastPos = xTextViewCursor.getPosition().X;
  iScale = (iLastPos-iFirstPos)/iScaleLen;
  xTextCursor.gotoStart(false);
  xTextCursor.gotoEnd(true);
  xTextCursor.setString("");
  xTextDocument.unlockControllers();
  return iScale;
    }   
   
View Full Code Here

        assure("createTextCursor(): no cursor", xTextCursor != null);

        // XTextCursor
        boolean bSuccess = false;
        xTextCursor.gotoStart(false);
        xTextCursor.gotoEnd(false);
        bSuccess = xTextCursor.goLeft((short)1, false);
        assure("goLeft(): failed", bSuccess);
        bSuccess = xTextCursor.goLeft((short)1000, false);
        assure("goLeft(): succeeded", !bSuccess);
        bSuccess = xTextCursor.goRight((short)1, false);
View Full Code Here

        {
            String string = xTextCursor.getString();
            assure("gotoEndOfWord(): wrong string: " + string,
                    "Two".equals(string));
        }
        xTextCursor.gotoEnd(false);
        bSuccess = xWordCursor.gotoStartOfWord(true);
        assure("gotoStartOfWord(): failed", bSuccess);
        {
            String string = xTextCursor.getString();
            assure("gotoStartOfWord(): wrong string: " + string,
View Full Code Here

        bSuccess = xSentenceCursor.gotoNextSentence(false);
        assure("gotoNextSentence(): succeeded", !bSuccess);
        // FIXME:
        // the sentence cursor seems to work differently than the word cursor
        xText.setString("This is a sentence. Another sentence. Sentence 3.");
        xTextCursor.gotoEnd(false);
        bSuccess = xSentenceCursor.gotoPreviousSentence(true);
        assure("gotoPreviousSentence(): failed", bSuccess);
        {
            String string = xTextCursor.getString();
            assure("gotoPreviousSentence(): wrong string: " + string,
View Full Code Here

        {
            String string = xTextCursor.getString();
            assure("gotoEndOfSentence(): wrong string: " + string,
                    "This is a sentence.".equals(string));
        }
        xTextCursor.gotoEnd(false);
        bSuccess = xSentenceCursor.gotoStartOfSentence(true);
        assure("gotoStartOfSentence(): failed", bSuccess);
        {
            String string = xTextCursor.getString();
            assure("gotoStartOfSentence(): wrong string: " + string,
View Full Code Here

            XTextCursor xTextCursor = xText.createTextCursor();
            xTextCursor.gotoStart(false);

            // insertTextContent with meta cursor
            xText.insertTextContent(xTextCursor, xContent1, false);
            xTextCursor.gotoEnd(false);
            xText.insertTextContent(xTextCursor, xContent2, false);

            helper.postInserted(nod1, xContent1);
            helper.postInserted(nod2, xContent2);
View Full Code Here

            xTextCursor.gotoStart(false);
            xTextCursor.goRight((short)1, true);

            // insertTextContent with meta cursor and absorb
            xText.insertTextContent(xTextCursor, xContent1, true);
            xTextCursor.gotoEnd(false);
            xTextCursor.goLeft((short)1, true);
            xText.insertTextContent(xTextCursor, xContent2, true);

            helper.postInserted(nod1, xContent1);
            helper.postInserted(nod2, xContent2);
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.