Examples of XText


Examples of com.sun.star.text.XText

    public void before() {
        log.println( "creating a text document" );
        xTextDoc = WriterTools.createTextDoc( (XMultiServiceFactory) param.getMSF());

        XText oText = xTextDoc.getText();
        XTextCursor oCursor = oText.createTextCursor();

        log.println( "inserting some lines" );
        try {
            for (int i=0; i<5; i++){
                oText.insertString( oCursor,"Paragraph Number: " + i, false);
                oText.insertControlCharacter(
                        oCursor, ControlCharacter.PARAGRAPH_BREAK, false );
            }
        } catch ( com.sun.star.lang.IllegalArgumentException e ){
            e.printStackTrace((PrintWriter)log);
            throw new StatusException( "Couldn't insert lines", e );
View Full Code Here

Examples of com.sun.star.text.XText

            failed(e.getMessage());
            return;
        }

        // insert text into header
        XText center = RPHFC.getCenterText();
        center.setString("First line \n\r Second line \n\r third line ");
        try {
            PropSet.setPropertyValue("RightPageHeaderContent",RPHFC);
        } catch (com.sun.star.beans.UnknownPropertyException e) {
        } catch (com.sun.star.beans.PropertyVetoException e) {
        } catch (com.sun.star.lang.IllegalArgumentException e) {
        } catch (com.sun.star.lang.WrappedTargetException e) {}

        // get footer
        RPHFC = null;
        try {
            Object o = PropSet.getPropertyValue("RightPageHeaderContent");
            RPHFC = (XHeaderFooterContent)AnyConverter.toObject(
                    new com.sun.star.uno.Type(XHeaderFooterContent.class), o);
        } catch(com.sun.star.lang.IllegalArgumentException e) {
            failed(e.getMessage());
        } catch(com.sun.star.lang.WrappedTargetException e){
            failed(e.getMessage());
            return;
        } catch(com.sun.star.beans.UnknownPropertyException e){
            failed(e.getMessage());
            return;
        }

        // insert text into footer
        center = RPHFC.getCenterText();
        center.setString("Third last line\n\r Second last line\n\r last line");
        try {
            PropSet.setPropertyValue("RightPageFooterContent",RPHFC);
        } catch (com.sun.star.beans.UnknownPropertyException e) {
        } catch (com.sun.star.beans.PropertyVetoException e) {
        } catch (com.sun.star.lang.IllegalArgumentException e) {
View Full Code Here

Examples of com.sun.star.text.XText

            failed(e.getMessage());
            return;
        }

        // insert text into header
        XText center = RPHFC.getCenterText();
        center.setString("First line \n\r Second line \n\r third line ");
        try {
            PropSet.setPropertyValue("RightPageHeaderContent",RPHFC);
        } catch (com.sun.star.beans.UnknownPropertyException e) {
        } catch (com.sun.star.beans.PropertyVetoException e) {
        } catch (com.sun.star.lang.IllegalArgumentException e) {
        } catch (com.sun.star.lang.WrappedTargetException e) {}

        // get footer
        RPHFC = null;
        try {
            Object o = PropSet.getPropertyValue("RightPageFooterContent");
            RPHFC = (XHeaderFooterContent)AnyConverter.toObject(
                    new com.sun.star.uno.Type(XHeaderFooterContent.class), o);
        } catch(com.sun.star.lang.IllegalArgumentException e) {
            failed(e.getMessage());
        } catch(com.sun.star.lang.WrappedTargetException e){
            failed(e.getMessage());
            return;
        } catch(com.sun.star.beans.UnknownPropertyException e){
            failed(e.getMessage());
            return;
        }

        // insert text into footer
        center = RPHFC.getCenterText();
        center.setString("Third last line\n\r Second last line\n\r last line");
        try {
            PropSet.setPropertyValue("RightPageFooterContent",RPHFC);
        } catch (com.sun.star.beans.UnknownPropertyException e) {
        } catch (com.sun.star.beans.PropertyVetoException e) {
        } catch (com.sun.star.lang.IllegalArgumentException e) {
View Full Code Here

Examples of com.sun.star.text.XText

            e.printStackTrace(log) ;
            throw new StatusException(
                "Error getting cell object from spreadsheet document",e) ;
        }

        XText aText = (XText) UnoRuntime.queryInterface(XText.class, aCell);
        aText.setString("ScCellTextCursor");
        oObj = aText.createTextCursor();

        log.println( "creating a new environment for ScCellTextCursor object" );
        TestEnvironment tEnv = new TestEnvironment( oObj );

        // Object relations for interface tests
View Full Code Here

Examples of com.sun.star.text.XText

            throw new StatusException("Couldn't get HeaderContent", e);
        }
       
        final XHeaderFooterContent RPHC2 = RPHC;
       
        final XText center = RPHC2.getCenterText();
        final XText left = RPHC2.getLeftText();
        final XText right = RPHC2.getRightText();

        tEnv.addObjRelation("EventProducer",
            new ifc.accessibility._XAccessibleEventBroadcaster.EventProducer(){
                public void fireEvent() {
                    center.setString("CENTER");
                    left.setString("LEFT");
                    right.setString("RIGHT");
                    try {
                        PropSet.setPropertyValue("RightPageHeaderContent",RPHC2);
                    } catch (com.sun.star.beans.UnknownPropertyException e) {
                    } catch (com.sun.star.beans.PropertyVetoException e) {
                    } catch (com.sun.star.lang.IllegalArgumentException e) {
View Full Code Here

Examples of com.sun.star.text.XText

    * Test calls the method and checks string obtained from returned value. <p>
    * Has <b>OK</b> status if obtained string is equal to <code>"LEFT"</code>.
    * <p>
    */
    public void _getLeftText() {
        XText left = oObj.getLeftText();
        tRes.tested("getLeftText()",left.getString().equals("LEFT"));
    }
View Full Code Here

Examples of com.sun.star.text.XText

    * Test calls the method and checks string obtained from returned value. <p>
    * Has <b>OK</b> status if obtained string is equal to <code>"RIGHT"</code>.
    * <p>
    */
    public void _getRightText() {
        XText right = oObj.getRightText();
        tRes.tested("getRightText()",right.getString().equals("RIGHT"));
    }
View Full Code Here

Examples of com.sun.star.text.XText

    * Test calls the method and checks string obtained from returned value. <p>
    * Has <b>OK</b> status if obtained string is equal to <code>"CENTER"</code>.
    * <p>
    */
    public void _getCenterText() {
        XText center = oObj.getCenterText();
        tRes.tested("getCenterText()",center.getString().equals("CENTER"));
    }
View Full Code Here

Examples of com.sun.star.text.XText

        requiredMethod("clearArrows()");
        // construct an error: square root from -3
        xPrecedentAddress.setValue(-9);
        String cellAddress = new String(new byte[]{(byte)(precedentAddress.Column + 65)}) + (precedentAddress.Row+1);
        xAddress.setFormula("=SQRT(" + cellAddress + ")");
        XText xText = (XText)UnoRuntime.queryInterface(XText.class, xAddress);
        // correct error in cell:
        String error = xText.getString();
        boolean erg = error.equals("Err:502");
        log.println("Content: " + error);
        oObj.showErrors(dependentAddress);
        erg &= hasRightAmountOfShapes(2);
        tRes.tested("showErrors()", erg);
View Full Code Here

Examples of com.sun.star.text.XText

                                         String pic, String name) {
        try {
            Object oGObject = (XInterface) xMSF.createInstance(
                                      "com.sun.star.text.GraphicObject");

            XText the_text = aDoc.getText();
            XTextCursor the_cursor = the_text.createTextCursor();
            XTextContent the_content = (XTextContent) UnoRuntime.queryInterface(
                                               XTextContent.class, oGObject);
            the_text.insertTextContent(the_cursor, the_content, true);

            XPropertySet oProps = (XPropertySet) UnoRuntime.queryInterface(
                                          XPropertySet.class, oGObject);

            String fullURL = util.utils.getFullTestURL(pic);
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.