Examples of XSimpleText


Examples of com.sun.star.text.XSimpleText

            SOfficeFactory SOF = SOfficeFactory.getFactory((XMultiServiceFactory)tParam.getMSF()) ;
            XShape oShape = SOF.createShape
                (xDrawDoc,5000,3500,7500,5000,"Text");
            DrawTools.getShapes(DrawTools.getDrawPage(xDrawDoc,0)).add(oShape) ;

            XSimpleText text = (XSimpleText) UnoRuntime.queryInterface
                (XSimpleText.class, oShape) ;

            XTextCursor cursor = text.createTextCursor() ;

            text.insertString(cursor, "Paragraph 1", false) ;
            text.insertControlCharacter(cursor,
                ControlCharacter.PARAGRAPH_BREAK, false) ;
            text.insertString(cursor, "Paragraph 2", false) ;
            text.insertControlCharacter(cursor,
                ControlCharacter.PARAGRAPH_BREAK, false) ;
            text.insertString(cursor, "Paragraph 3", false) ;
            text.insertControlCharacter(cursor,
                ControlCharacter.PARAGRAPH_BREAK, false) ;

            xEA = (XEnumerationAccess) UnoRuntime.queryInterface
                (XEnumerationAccess.class, text) ;
View Full Code Here

Examples of com.sun.star.text.XSimpleText

            SOfficeFactory SOF = SOfficeFactory.getFactory((XMultiServiceFactory)tParam.getMSF()) ;
            XShape oShape = SOF.createShape
                (xDrawDoc,5000,3500,7500,5000,"Text");
            DrawTools.getShapes(DrawTools.getDrawPage(xDrawDoc,0)).add(oShape) ;

            XSimpleText text = (XSimpleText) UnoRuntime.queryInterface
                (XSimpleText.class, oShape) ;

            XTextCursor cursor = text.createTextCursor() ;

            text.insertString(cursor, "Paragraph 1", false) ;
            text.insertControlCharacter(cursor,
                ControlCharacter.PARAGRAPH_BREAK, false) ;
            text.insertString(cursor, "Paragraph 2", false) ;
            text.insertControlCharacter(cursor,
                ControlCharacter.PARAGRAPH_BREAK, false) ;
            text.insertString(cursor, "Paragraph 3", false) ;
            text.insertControlCharacter(cursor,
                ControlCharacter.PARAGRAPH_BREAK, false) ;

            xEA = (XEnumerationAccess) UnoRuntime.queryInterface
                (XEnumerationAccess.class, text) ;
View Full Code Here

Examples of com.sun.star.text.XSimpleText


        // get the bodytext of textdocument here
        log.println("getting the TextCursor");

        final XSimpleText aText = xTextDoc.getText();
        final XTextCursor textCursor = aText.createTextCursor();
        oObj = textCursor;

        log.println("inserting some text");

        try {
            for (int i = 0; i < 3; i++) {
                aText.insertString(textCursor, "" + (3 - i), false);

                for (int j = 0; j < 5; j++) {
                    aText.insertString(textCursor, "XTextCursor,XTextCursor",
                                       false);
                    aText.insertString(textCursor, "The quick brown fox ",
                                       false);
                    aText.insertString(textCursor, "jumps over the lazy dog ",
                                       false);
                }

                aText.insertControlCharacter(textCursor,
                                             ControlCharacter.PARAGRAPH_BREAK,
                                             false);
                aText.insertControlCharacter(textCursor,
                                             ControlCharacter.LINE_BREAK,
                                             false);
            }
        } catch (com.sun.star.lang.IllegalArgumentException e) {
            log.println("Error, insert text to text document.");
            e.printStackTrace(log);
        }

        log.println("creating a new environment for SwXTextCursor object");

        TestEnvironment tEnv = new TestEnvironment(oObj);

        tEnv.addObjRelation("XTEXT", xTextDoc.getText());

        XPropertySet xCursorProp = (XPropertySet) UnoRuntime.queryInterface(
                                           XPropertySet.class, oObj);
        tEnv.addObjRelation("PropertyNames", getPropertyNames(xCursorProp));

        //Adding relation for util.XSortable
        final XParagraphCursor paragrCursor = (XParagraphCursor) UnoRuntime.queryInterface(
                                                      XParagraphCursor.class,
                                                      oObj);
        final PrintWriter finalLog = log;

        tEnv.addObjRelation("SORTCHECKER",
                            new ifc.util._XSortable.XSortChecker() {
            PrintWriter out = finalLog;

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

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

                try {
                    aText.insertControlCharacter(textCursor,
                                                 ControlCharacter.PARAGRAPH_BREAK,
                                                 false);
                    aText.insertString(textCursor, "4", false);
                    aText.insertControlCharacter(textCursor,
                                                 ControlCharacter.PARAGRAPH_BREAK,
                                                 false);
                    aText.insertString(textCursor, "b", false);
                    aText.insertControlCharacter(textCursor,
                                                 ControlCharacter.PARAGRAPH_BREAK,
                                                 false);
                    aText.insertString(textCursor, "3", false);
                    aText.insertControlCharacter(textCursor,
                                                 ControlCharacter.PARAGRAPH_BREAK,
                                                 false);
                    aText.insertString(textCursor, "a", false);
                    aText.insertControlCharacter(textCursor,
                                                 ControlCharacter.PARAGRAPH_BREAK,
                                                 false);
                    aText.insertString(textCursor, "23", false);
                    aText.insertControlCharacter(textCursor,
                                                 ControlCharacter.PARAGRAPH_BREAK,
                                                 false);
                    aText.insertString(textCursor, "ab", false);
                    aText.insertControlCharacter(textCursor,
                                                 ControlCharacter.PARAGRAPH_BREAK,
                                                 false);
                } catch (com.sun.star.lang.IllegalArgumentException e) {
                    out.println("Unexpected exception:" + e);
                }
View Full Code Here

Examples of com.sun.star.text.XSimpleText

        CharLocale = (Locale) Helper.getUnoStructValue((Object) xComponent, "CharLocale");
    }

    public static XTextCursor createTextCursor(Object oCursorContainer)
    {
        XSimpleText xText = UnoRuntime.queryInterface(XSimpleText.class, oCursorContainer);
        return xText.createTextCursor();
    }
View Full Code Here

Examples of com.sun.star.text.XSimpleText

        } catch (com.sun.star.lang.IllegalArgumentException e) {
            e.printStackTrace(log);
            throw new StatusException("Couldn't insert the footnote", e);
        }

        XSimpleText oFootText = (XSimpleText)
            UnoRuntime.queryInterface(XSimpleText.class, oFootnote);
        oFootText.setString("SwXFootnoteText");

        oObj = oFootText.getText();

        TestEnvironment tEnv = new TestEnvironment(oObj);

        log.println( "adding TextDocument as mod relation to environment" );
        tEnv.addObjRelation("TEXT", (XText) oObj);
View Full Code Here

Examples of com.sun.star.text.XSimpleText

                "com.sun.star.comp.Writer.XMLExporter", new Object[] {arg});
            XExporter xEx = (XExporter) UnoRuntime.queryInterface
                (XExporter.class,oObj);
            xEx.setSourceDocument(xTextDoc);

            XSimpleText aText = xTextDoc.getText();
            XTextCursor curs = (XTextCursor) aText.createTextCursor();
                        aText.insertString(curs, TEST_STR, false);
        } catch (com.sun.star.uno.Exception e) {
            e.printStackTrace(log) ;
            throw new StatusException("Can't create component.", e) ;
        }
View Full Code Here

Examples of com.sun.star.text.XSimpleText

        log.println("creating a test environment");

        // get the bodytext of textdocument here
        log.println("getting the TextCursor");

        final XSimpleText aText = xTextDoc.getText();
        final XTextCursor textCursor = aText.createTextCursor();
        oObj = textCursor;

        TestEnvironment tEnv = new TestEnvironment(oObj);

        return tEnv;
View Full Code Here

Examples of com.sun.star.text.XSimpleText

        tRes.tested( "removeByIndex()", result );
    } // end removeByIndex()

    private void setCellText(XCell cell, String text) {
        XSimpleText xText = (XSimpleText) UnoRuntime.queryInterface
            (XSimpleText.class, cell) ;
        xText.setString(text);
    }
View Full Code Here

Examples of com.sun.star.text.XSimpleText

        XSimpleText xText = (XSimpleText) UnoRuntime.queryInterface
            (XSimpleText.class, cell) ;
        xText.setString(text);
    }
    private String getCellText(XCell cell) {
        XSimpleText xText = (XSimpleText) UnoRuntime.queryInterface
            (XSimpleText.class, cell) ;
        return xText.getString();
    }
View Full Code Here

Examples of com.sun.star.text.XSimpleText

            SOfficeFactory SOF = SOfficeFactory.getFactory((XMultiServiceFactory)tParam.getMSF()) ;
            XShape oShape = SOF.createShape(xDrawDoc,
                5000,3500,7500,5000,"Text");
            DrawTools.getShapes(DrawTools.getDrawPage(xDrawDoc,0)).add(oShape) ;

            XSimpleText text = (XSimpleText) UnoRuntime.queryInterface
                (XSimpleText.class, oShape) ;

            XTextCursor cursor = text.createTextCursor() ;

            text.insertString(cursor, "Paragraph 1", false) ;
            text.insertControlCharacter(cursor,
                ControlCharacter.PARAGRAPH_BREAK, false) ;
            text.insertString(cursor, "Paragraph 2", false) ;
            text.insertControlCharacter(cursor,
                ControlCharacter.PARAGRAPH_BREAK, false) ;
            text.insertString(cursor, "Paragraph 3", false) ;
            text.insertControlCharacter(cursor,
                ControlCharacter.PARAGRAPH_BREAK, false) ;

            xEA = (XEnumerationAccess) UnoRuntime.queryInterface
                (XEnumerationAccess.class, text) ;
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.