Examples of XTextFrame


Examples of com.sun.star.text.XTextFrame

    {
        try
        {
            // Use the document's factory to create a new text frame and
            // immediately access it's XTextFrame interface
            XTextFrame xFrame = (XTextFrame) UnoRuntime.queryInterface (
                XTextFrame.class, mxDocFactory.createInstance (
                    "com.sun.star.text.TextFrame" ) );
           
            // Access the XShape interface of the TextFrame
            XShape xShape = (XShape)UnoRuntime.queryInterface(XShape.class, xFrame);
            // Access the XPropertySet interface of the TextFrame
            XPropertySet xFrameProps = (XPropertySet)UnoRuntime.queryInterface(
                XPropertySet.class, xFrame );
           
            // Set the size of the new Text Frame using the XShape's 'setSize'
            // method
            Size aSize = new Size();
            aSize.Height = 400;
            aSize.Width = 15000;
            xShape.setSize(aSize);
            // Set the AnchorType to
            // com.sun.star.text.TextContentAnchorType.AS_CHARACTER
            xFrameProps.setPropertyValue( "AnchorType",
                                          TextContentAnchorType.AS_CHARACTER );
            // Go to the end of the text document
            mxDocCursor.gotoEnd( false );
            // Insert a new paragraph
            mxDocText.insertControlCharacter (
                mxDocCursor, ControlCharacter.PARAGRAPH_BREAK, false );
            // Then insert the new frame
            mxDocText.insertTextContent(mxDocCursor, xFrame, false);
           
            // 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.",
View Full Code Here

Examples of com.sun.star.text.XTextFrame

    * <code>XTextFramesSupplier</code> interface.<br>
    */
    public synchronized TestEnvironment createTestEnvironment(
            TestParameters Param, PrintWriter log ) throws StatusException {
        XInterface oObj = null;
        XTextFrame oFrame1 = null;
        XText oText = null;
        XTextCursor oCursor = null;
        XMultiServiceFactory oDocMSF = null;
        XTextFramesSupplier oInterface = null;

View Full Code Here

Examples of com.sun.star.text.XTextFrame

        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);
View Full Code Here

Examples of com.sun.star.text.XTextFrame

     *    creating a Testenvironment for the interfaces to be tested
     */
    public synchronized TestEnvironment createTestEnvironment(TestParameters Param,
                                                              PrintWriter log) {
        XInterface oObj = null;
        XTextFrame oFrame1 = null;
        XTextFrame oFrame2 = null;
        XPropertySet oPropSet = null;
        XText oText = null;
        XTextCursor oCursor = null;


View Full Code Here

Examples of com.sun.star.text.XTextFrame

    {
        XTextFramesSupplier xFrameSupplier = (XTextFramesSupplier) UnoRuntime.queryInterface(XTextFramesSupplier.class, xTD);
        if (xFrameSupplier.getTextFrames().hasByName(sFrameName))
        {
            Object oTextFrame = xFrameSupplier.getTextFrames().getByName(sFrameName);
            XTextFrame xTextFrame = (XTextFrame) UnoRuntime.queryInterface(XTextFrame.class, oTextFrame);
            return xTextFrame;
        }
        return null;
    }
View Full Code Here

Examples of com.sun.star.text.XTextFrame

        }
    }

    public void chkCompanyReceiverItemChanged()
    {
        XTextFrame xReceiverFrame = null;

        if (chkCompanyReceiver.getState() != 0)
        {
            try
            {
View Full Code Here

Examples of com.sun.star.text.XTextFrame

    */
    protected TestEnvironment createTestEnvironment(
        TestParameters Param, PrintWriter log) {

        XInterface oObj = null;
        XTextFrame oFrame1 = null;
        XPropertySet oPropSet = null;
        XText oText = null;
        XTextCursor oCursor = null;

        // get a soffice factory object
View Full Code Here

Examples of com.sun.star.text.XTextFrame


    // Create a TextFrame
   
    XTextFrame TF = null;
    XShape TFS = null;
   
    try {
      oInt = oDocMSF.createInstance("com.sun.star.text.TextFrame");
      TF = (XTextFrame) UnoRuntime.queryInterface(XTextFrame.class,oInt);
      TFS = (XShape) UnoRuntime.queryInterface(XShape.class,oInt);
     
      Size aSize = new Size();
      aSize.Height = 400;
      aSize.Width = 15000;
   
      TFS.setSize(aSize);

    } catch (Exception e) {
      System.out.println("Couldn't create instance "+ e);
    }
        
        
    // get the property set of the text frame
   
    XPropertySet oTFPS = (XPropertySet)UnoRuntime.queryInterface( XPropertySet.class, TF );
   
    // Change the AnchorType
    try {
   
      oTFPS.setPropertyValue("AnchorType", TextContentAnchorType.AS_CHARACTER);
     
    } catch (Exception e) {
      System.out.println("Couldn't change the color " + e);
    }
             
   
    //insert the frame
    System.out.println("insert the text frame");
   
    try {
      oText.insertTextContent(oCursor, TF, false);
    } catch (Exception e) {
      System.out.println("Couldn't insert the frame " + e);
    }
    //getting the text object of Frame
    XText oTex = TF.getText();
   
    //create a cursor object
    XTextCursor oCurso = oTex.createTextCursor();
   
    //inserting some Text
View Full Code Here

Examples of com.sun.star.text.XTextFrame

    {
            try
            {
                    // Use the document's factory to create a new text frame and immediately access
                    // it's XTextFrame interface
                    XTextFrame xFrame = (XTextFrame) UnoRuntime.queryInterface (
                            XTextFrame.class, mxDocFactory.createInstance (
                                    "com.sun.star.text.TextFrame" ) );

                    // Access the XShape interface of the TextFrame
                    XShape xShape = (XShape) UnoRuntime.queryInterface(XShape.class, xFrame);
                    // Access the XPropertySet interface of the TextFrame
                    XPropertySet xFrameProps = (XPropertySet)UnoRuntime.queryInterface(
                            XPropertySet.class, xFrame );

                    // Set the size of the new Text Frame using the XShape's 'setSize' method
                    Size aSize = new Size();
                    aSize.Height = 400;
                    aSize.Width = 15000;
                    xShape.setSize(aSize);
                    // Set the AnchorType to com.sun.star.text.TextContentAnchorType.AS_CHARACTER
                    xFrameProps.setPropertyValue( "AnchorType", TextContentAnchorType.AS_CHARACTER );
                    // Go to the end of the text document
                    mxDocCursor.gotoEnd( false );
                    // Insert a new paragraph
                    mxDocText.insertControlCharacter (
                            mxDocCursor, ControlCharacter.PARAGRAPH_BREAK, false );
                    // Then insert the new frame
                    mxDocText.insertTextContent(mxDocCursor, xFrame, false);

                    // 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 );
View Full Code Here

Examples of com.sun.star.text.XTextFrame

    {
        try
        {
            // Use the document's factory to create a new text frame and
            // immediately access it's XTextFrame interface
            XTextFrame xFrame = (XTextFrame) UnoRuntime.queryInterface (
                XTextFrame.class, mxDocFactory.createInstance (
                    "com.sun.star.text.TextFrame" ) );
           
            // Access the XShape interface of the TextFrame
            XShape xShape = (XShape)UnoRuntime.queryInterface(XShape.class, xFrame);
            // Access the XPropertySet interface of the TextFrame
            XPropertySet xFrameProps = (XPropertySet)UnoRuntime.queryInterface(
                XPropertySet.class, xFrame );
           
            // Set the size of the new Text Frame using the XShape's 'setSize'
            // method
            Size aSize = new Size();
            aSize.Height = 400;
            aSize.Width = 15000;
            xShape.setSize(aSize);
            // Set the AnchorType to
            // com.sun.star.text.TextContentAnchorType.AS_CHARACTER
            xFrameProps.setPropertyValue( "AnchorType",
                                          TextContentAnchorType.AS_CHARACTER );
            // Go to the end of the text document
            mxDocCursor.gotoEnd( false );
            // Insert a new paragraph
            mxDocText.insertControlCharacter (
                mxDocCursor, ControlCharacter.PARAGRAPH_BREAK, false );
            // Then insert the new frame
            mxDocText.insertTextContent(mxDocCursor, xFrame, false);
           
            // 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.",
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.