Package com.sun.star.text

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


        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

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

            // attach to cursor from meta XText
            xContent1.attach(xTextCursor);
            xTextCursor.gotoEnd(false);
            xContent2.attach(xTextCursor);

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

            com.sun.star.awt.FontSlant.ITALIC);
        xCursorProps.setPropertyValue("CharWeight",
            new Float(com.sun.star.awt.FontWeight.BOLD));

        // add more text at the end of the text using insertString
        xTextCursor.gotoEnd(false);
        xText.insertString(xTextCursor, " The mountainside sloped gently where he lay; "
            + "but below it was steep and he could see the dark of the oiled road "
            + "winding through the pass. There was a stream alongside the road "
            + "and far down the pass he saw a mill beside the stream and the falling water "
            + "of the dam, white in the summer sunlight.", false);
View Full Code Here

    String sText = "";

    if (xText != null) {
      XTextCursor xTextCursor = xText.createTextCursor();
      xTextCursor.gotoStart(false);
      xTextCursor.gotoEnd(true);
      sText = xTextCursor.getString();
    }
    return sText;       
  }
View Full Code Here

    XText xText = getXText();

    if (xText != null) {
      XTextCursor xTextCursor = xText.createTextCursor();
      xTextCursor.gotoStart(false);
      xTextCursor.gotoEnd(true);
      xTextCursor.setString(s);
    }
  }

  /** Method to get the XTextDocument interface.
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.