Package com.sun.star.text

Examples of com.sun.star.text.XTextContent


                TextContentAnchorType.AS_CHARACTER);
            oText = xTextDoc.getText();
            oCursor = oText.createTextCursor();

            log.println( "inserting Frame1" );
            XTextContent the_content = (XTextContent)
                UnoRuntime.queryInterface(XTextContent.class, oFrame1);
            oText.insertTextContent(oCursor, the_content, true);
        } catch (Exception e) {
            e.printStackTrace(log);
            throw new StatusException("Couldn't insert TextFrame", e);
View Full Code Here


        }
        return false;
    }
    @Override
    public XTextRange getTextRange(){
        XTextContent xTCxEOS = (XTextContent)
                UnoRuntime.queryInterface(XTextContent.class, xEOS);
        XTextRange xTextRange = xTCxEOS.getAnchor();
        return xTextRange;
    }
View Full Code Here

            else{
                XMultiServiceFactory xMSF =
                        (XMultiServiceFactory) UnoRuntime.queryInterface(
                        XMultiServiceFactory.class,
                        oooDocument.getTextDocument());
                XTextContent xTC =
                        (XTextContent)(UnoRuntime.queryInterface(
                        XTextContent.class,xMSF.createInstance(
                        "com.sun.star.text.TextEmbeddedObject")));
                /* Position chart inline. */
                XPropertySet xFrameProps =
View Full Code Here

                "OOOExpression.dispose() called for "+this);
//        xEOS.getEmbeddedObject().dispose();
    }
    @Override
    public XTextRange getTextRange(){
        XTextContent xTCxEOS = (XTextContent)
                UnoRuntime.queryInterface(XTextContent.class, xEOS);
        XTextRange xTextRange = xTCxEOS.getAnchor();
        return xTextRange;
    }
View Full Code Here

        return xTextRange;
    }

    public XTextCursor getTextCursor(){
        // Text anchor associated with the formula
        XTextContent xTCxEOS = (XTextContent)
                UnoRuntime.queryInterface(XTextContent.class, xEOS);
        return xTCxEOS.getAnchor().getText()
                .createTextCursorByRange(xTCxEOS.getAnchor().getEnd());
    }
View Full Code Here

                if (formulaSelected){
                    updateExpression(fieldText);

                }
                else{
                    XTextContent xTC = createExpression(fieldText);
                    // controller should have been set in createExpression
                    XSelectionSupplier xSelSup = (XSelectionSupplier) UnoRuntime.queryInterface(
                                XSelectionSupplier.class, controller);
                    xSelSup.select(xTC);
                        // Move the cursor to the right
                }
            }
            if ( aURL.Path.compareTo("editExprField") == 0 ){
                // if control is activated (by pressing "return")
                if (aArguments[0].Name.equals("KeyModifier")){
                    // If formula is selected, then update the formula
                    if (formulaSelected){
                        myLogger.log(
                                Level.FINE, "updating expression");
                        updateExpression(fieldText);
                    }
                    else{
                        myLogger.log(
                                Level.FINE, "logger: "+myLogger);
                        myLogger.fine("creating new expression");
                        myLogger.log(
                                Level.FINE, "creating new expression");
                        XTextContent xTC = createExpression(fieldText);
                        // controller should have been set in createExpression
//                        XSelectionSupplier xSelSup = (XSelectionSupplier) UnoRuntime.queryInterface(
//                                    XSelectionSupplier.class, controller);
//                        xSelSup.select(xTC);
                        ((XSelectionSupplier) UnoRuntime.queryInterface(
View Full Code Here

                    Level.FINE, "createExpression");
        XFrame xFrame = m_xFrame;
        XMultiServiceFactory xMSF = (XMultiServiceFactory)
                UnoRuntime.queryInterface(XMultiServiceFactory.class,
                    xFrame.getController().getModel());
        XTextContent xObj = (XTextContent) UnoRuntime.queryInterface(
                XTextContent.class,
                xMSF.createInstance( "com.sun.star.text.TextEmbeddedObject" ));
        XPropertySet xPS = (com.sun.star.beans.XPropertySet)
                UnoRuntime.queryInterface(XPropertySet.class, xObj);
        xPS.setPropertyValue("CLSID", com.CompPad.OOO.OOODocument.CLSID_FORMULA);
View Full Code Here

            String sTableName = sTableNames[i];
            if (JavaTools.FieldInList(sLayoutTableNames, sTableName) > -1)
            {
                if (!sTableName.equals(sLayoutTableNames[0]))
                {
                    XTextContent xTextContent = (XTextContent) UnoRuntime.queryInterface(XTextContent.class, oTextTableHandler.getByName(sTableName));
                    boolean bleaveloop = false;
                    while (!bleaveloop)
                    {
                        try
                        {
View Full Code Here

    {
        XNamed xNamedTextSection = null;
        try
        {
            XInterface xTextSection = (XInterface) getDocumentServiceFactory().createInstance("com.sun.star.text.TextSection");
            XTextContent xTextSectionContent = (XTextContent) UnoRuntime.queryInterface(XTextContent.class, xTextSection);
            xNamedTextSection = (XNamed) UnoRuntime.queryInterface(XNamed.class, xTextSection);
            xTextCursor.gotoEnd(false);
            xTextCursor.getText().insertTextContent(xTextCursor, xTextSectionContent, true);
            Helper.setUnoPropertyValue(xTextSection, "LinkRegion", sLinkRegion);
            if (CurDBColumn != null)
View Full Code Here

        XTextCursor xCursor = xTextDoc.getText().createTextCursor();
        try {
            XMultiServiceFactory xMultiServiceFactory = (XMultiServiceFactory)
                UnoRuntime.queryInterface(XMultiServiceFactory.class, xTextDoc);
            Object o = xMultiServiceFactory.createInstance("com.sun.star.text.TextEmbeddedObject" );
            XTextContent xTextContent = (XTextContent)UnoRuntime.queryInterface(XTextContent.class, o);
            String sChartClassID = "12dcae26-281f-416f-a234-c3086127382e";
            XPropertySet xPropertySet = (XPropertySet)
                UnoRuntime.queryInterface(XPropertySet.class, xTextContent);
            xPropertySet.setPropertyValue( "CLSID", sChartClassID );

            xTextDoc.getText().insertTextContent( xCursor, xTextContent, false );
        }
        catch(com.sun.star.uno.Exception e) {
            e.printStackTrace((java.io.PrintWriter)log);
        }

        XTextEmbeddedObjectsSupplier oTEOS = (XTextEmbeddedObjectsSupplier) UnoRuntime.queryInterface(
                                                     XTextEmbeddedObjectsSupplier.class,
                                                     xTextDoc);

        XNameAccess oEmObj = oTEOS.getEmbeddedObjects();
        XIndexAccess oEmIn = (XIndexAccess) UnoRuntime.queryInterface(
                                     XIndexAccess.class, oEmObj);

        try {
            oObj = (XInterface) AnyConverter.toObject(
                           new Type(XInterface.class), oEmIn.getByIndex(0));
        } catch (com.sun.star.uno.Exception e) {
            e.printStackTrace(log);
            throw new StatusException("Couldn't get Object", e);
        }

        TestEnvironment tEnv = new TestEnvironment(oObj);

        tEnv.addObjRelation("NoAttach", "SwXTextEmbeddedObject");

        XTextFrame aFrame = SOF.createTextFrame(xTextDoc, 500, 500);
        XText oText = xTextDoc.getText();
        XTextCursor oCursor = oText.createTextCursor();
        XTextContent the_content = (XTextContent) UnoRuntime.queryInterface(
                                           XTextContent.class, aFrame);

        try {
            oText.insertTextContent(oCursor, the_content, true);
        } catch (com.sun.star.lang.IllegalArgumentException e) {
View Full Code Here

TOP

Related Classes of com.sun.star.text.XTextContent

Copyright © 2018 www.massapicom. 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.