Package com.sun.star.text

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


        TestEnvironment tEnv = new TestEnvironment(xTC);

        tEnv.addObjRelation("CONTENT", (XTextContent)
                        UnoRuntime.queryInterface(XTextContent.class,instance));
        oCursor.gotoEnd(false);
        tEnv.addObjRelation("RANGE", (XTextRange)
                        UnoRuntime.queryInterface(XTextRange.class, oCursor));

        // relation for XDocumentIndex
        tEnv.addObjRelation("TextDoc", xTextDoc);
View Full Code Here


        assertNotNull("createTextCursor(): no cursor", xTextCursor);

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

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

        bSuccess = xSentenceCursor.gotoNextSentence(false);
        assertFalse("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);
        assertTrue("gotoPreviousSentence(): failed", bSuccess);
        {
            String string = xTextCursor.getString();
            assertEquals("gotoPreviousSentence(): wrong string",
View Full Code Here

        {
            String string = xTextCursor.getString();
            assertEquals("gotoEndOfSentence(): wrong string",
                         "This is a sentence.", string);
        }
        xTextCursor.gotoEnd(false);
        bSuccess = xSentenceCursor.gotoStartOfSentence(true);
        assertTrue("gotoStartOfSentence(): failed", bSuccess);
        {
            String string = xTextCursor.getString();
            assertEquals("gotoStartOfSentence(): wrong 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

  {
    XText xText = (XText)
      UnoRuntime.queryInterface( XText.class, xShape );

    XTextCursor xTextCursor = xText.createTextCursor();
    xTextCursor.gotoEnd( false );
    if ( bNewParagraph == true )
    {
      xText.insertControlCharacter( xTextCursor, ControlCharacter.PARAGRAPH_BREAK, false );
      xTextCursor.gotoEnd( false );
    }
View Full Code Here

    XTextCursor xTextCursor = xText.createTextCursor();
    xTextCursor.gotoEnd( false );
    if ( bNewParagraph == true )
    {
      xText.insertControlCharacter( xTextCursor, ControlCharacter.PARAGRAPH_BREAK, false );
      xTextCursor.gotoEnd( false );
    }
    XTextRange xTextRange = (XTextRange)
      UnoRuntime.queryInterface( XTextRange.class, xTextCursor );
    xTextRange.setString( sText );
    xTextCursor.gotoEnd( true );
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.