Package com.sun.star.text

Examples of com.sun.star.text.XText.insertString()


            oFrame2 = SOF.createInstance(xTextDoc, "com.sun.star.text.TextFrame" );
            second = (XTextFrame)UnoRuntime.queryInterface
                ( XTextFrame.class, oFrame2);
            oText.insertTextContent(oCursor,second, false);
            second.getText().setString("Frame 2");
            oText.insertString( oCursor,
                "SwXTextRanges...SwXTextRanges...SwXTextRanges", false);
            oText.insertControlCharacter( oCursor,
                ControlCharacter.PARAGRAPH_BREAK, false);
            oText.insertString( oCursor,
                "bla...bla...", false);
View Full Code Here


            second.getText().setString("Frame 2");
            oText.insertString( oCursor,
                "SwXTextRanges...SwXTextRanges...SwXTextRanges", false);
            oText.insertControlCharacter( oCursor,
                ControlCharacter.PARAGRAPH_BREAK, false);
            oText.insertString( oCursor,
                "bla...bla...", false);
        } catch (Exception Ex ) {
            Ex.printStackTrace(log);
            throw new StatusException("Couldn't insert text table ", Ex);
        }
View Full Code Here

                    // Access the XText interface of the text contained within the frame
                    XText xFrameText = xFrame.getText();
                    // Create a TextCursor over the frame's contents
                    XTextCursor xFrameCursor = xFrameText.createTextCursor();
                    // Insert some text into the frame
                    xFrameText.insertString(
                            xFrameCursor, "The first line in the newly created text frame.", false );
                    xFrameText.insertString(
                            xFrameCursor, "\nThe second line in the new text frame.", false );
                    // Insert a paragraph break into the document (not the frame)
                    mxDocText.insertControlCharacter (
View Full Code Here

                    // Create a TextCursor over the frame's contents
                    XTextCursor xFrameCursor = xFrameText.createTextCursor();
                    // Insert some text into the frame
                    xFrameText.insertString(
                            xFrameCursor, "The first line in the newly created text frame.", false );
                    xFrameText.insertString(
                            xFrameCursor, "\nThe second line in the new text frame.", false );
                    // Insert a paragraph break into the document (not the frame)
                    mxDocText.insertControlCharacter (
                            mxDocCursor, ControlCharacter.PARAGRAPH_BREAK, false );
             }
View Full Code Here

       
        try {
            xTextCursor = (com.sun.star.text.XTextCursor) xTextDocument.getText().createTextCursor();
            XText xText = (XText) xTextDocument.getText();
           
            xText.insertString( xTextCursor, "He nervously looked all around. Suddenly he saw his ", false );
           
            xText.insertString( xTextCursor, "neighbour ", true );
            XPropertySet xCPS = (XPropertySet) UnoRuntime.queryInterface( XPropertySet.class, xTextCursor );
            xCPS.setPropertyValue( "CharColor", new Integer( 255 ) );// Set the word blue
            xTextCursor.gotoEnd(false); // Go to last character
View Full Code Here

            xTextCursor = (com.sun.star.text.XTextCursor) xTextDocument.getText().createTextCursor();
            XText xText = (XText) xTextDocument.getText();
           
            xText.insertString( xTextCursor, "He nervously looked all around. Suddenly he saw his ", false );
           
            xText.insertString( xTextCursor, "neighbour ", true );
            XPropertySet xCPS = (XPropertySet) UnoRuntime.queryInterface( XPropertySet.class, xTextCursor );
            xCPS.setPropertyValue( "CharColor", new Integer( 255 ) );// Set the word blue
            xTextCursor.gotoEnd(false); // Go to last character
            xCPS.setPropertyValue( "CharColor", new Integer( 0 ) );
           
View Full Code Here

            XPropertySet xCPS = (XPropertySet) UnoRuntime.queryInterface( XPropertySet.class, xTextCursor );
            xCPS.setPropertyValue( "CharColor", new Integer( 255 ) );// Set the word blue
            xTextCursor.gotoEnd(false); // Go to last character
            xCPS.setPropertyValue( "CharColor", new Integer( 0 ) );
           
            xText.insertString( xTextCursor, "in the alley. Like lightening he darted off to the left and disappeared between the two warehouses almost falling over the trash can lying in the ", false  );
           
            xText.insertString( xTextCursor, "centre ", true );
            xCPS = (XPropertySet) UnoRuntime.queryInterface( XPropertySet.class, xTextCursor );
            xCPS.setPropertyValue( "CharColor", new Integer( 255 ) );// Set the word blue
            xTextCursor.gotoEnd(false)// Go to last character
View Full Code Here

            xTextCursor.gotoEnd(false); // Go to last character
            xCPS.setPropertyValue( "CharColor", new Integer( 0 ) );
           
            xText.insertString( xTextCursor, "in the alley. Like lightening he darted off to the left and disappeared between the two warehouses almost falling over the trash can lying in the ", false  );
           
            xText.insertString( xTextCursor, "centre ", true );
            xCPS = (XPropertySet) UnoRuntime.queryInterface( XPropertySet.class, xTextCursor );
            xCPS.setPropertyValue( "CharColor", new Integer( 255 ) );// Set the word blue
            xTextCursor.gotoEnd(false)// Go to last character
            xCPS.setPropertyValue( "CharColor", new Integer( 0 ) );
           
View Full Code Here

            xCPS = (XPropertySet) UnoRuntime.queryInterface( XPropertySet.class, xTextCursor );
            xCPS.setPropertyValue( "CharColor", new Integer( 255 ) );// Set the word blue
            xTextCursor.gotoEnd(false)// Go to last character
            xCPS.setPropertyValue( "CharColor", new Integer( 0 ) );
           
            xText.insertString( xTextCursor, "of the sidewalk.", false );
           
            xText.insertControlCharacter( xTextCursor, com.sun.star.text.ControlCharacter.PARAGRAPH_BREAK, false );
            xText.insertString( xTextCursor, "He tried to nervously tap his way along in the inky darkness and suddenly stiffened: it was a dead-end, he would have to go back the way he had come.", false );
           
            xTextCursor.gotoStart(false);
View Full Code Here

            xCPS.setPropertyValue( "CharColor", new Integer( 0 ) );
           
            xText.insertString( xTextCursor, "of the sidewalk.", false );
           
            xText.insertControlCharacter( xTextCursor, com.sun.star.text.ControlCharacter.PARAGRAPH_BREAK, false );
            xText.insertString( xTextCursor, "He tried to nervously tap his way along in the inky darkness and suddenly stiffened: it was a dead-end, he would have to go back the way he had come.", false );
           
            xTextCursor.gotoStart(false);
        }
        catch( Exception e) {
            e.printStackTrace();
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.