Examples of XRelativeTextContentInsert


Examples of com.sun.star.text.XRelativeTextContentInsert

        try
        {
            // Go to the end of the document
            mxDocCursor.gotoEnd( false );
            // Get the RelativeTextContentInsert interface of the document
            XRelativeTextContentInsert xRelative =
                (XRelativeTextContentInsert ) UnoRuntime.queryInterface (
                    XRelativeTextContentInsert.class, mxDocText );

            // Use the document's factory to create the NumberingRules service,
            // and get it's XIndexAccess interface
            XIndexAccess xNum = (XIndexAccess) UnoRuntime.queryInterface(
                XIndexAccess.class,
                mxDocFactory.createInstance( "com.sun.star.text.NumberingRules" ) );

            // Also get the NumberingRule's XIndexReplace interface
            XIndexReplace xReplace = (XIndexReplace) UnoRuntime.queryInterface(
                XIndexReplace.class, xNum );

            // Create an array of XPropertySets, one for each of the three
            // paragraphs we're about to create
            XPropertySet xParas[] = new XPropertySet [ 3 ];
            for ( int i = 0 ; i < 3 ; ++ i )
            {
                // Create a new paragraph
                XTextContent xNewPara = (XTextContent) UnoRuntime.queryInterface(
                    XTextContent.class, mxDocFactory.createInstance(
                        "com.sun.star.text.Paragraph" ) );
               
                // Get the XPropertySet interface of the new paragraph and put
                // it in our array
                xParas[i] = (XPropertySet) UnoRuntime.queryInterface(
                    XPropertySet.class, xNewPara );

                // Insert the new paragraph into the document after the fish
                // section. As it is an insert relative to the fish section, the
                // first paragraph inserted will be below the next two
                xRelative.insertTextContentAfter ( xNewPara, mxFishSection );

                // Separate from the above, but also needs to be done three times

                // Get the PropertyValue sequence for this numbering level
                PropertyValue [] aProps = (PropertyValue [] ) xNum.getByIndex ( i );
View Full Code Here

Examples of com.sun.star.text.XRelativeTextContentInsert

           
            // Insert the 'Fish' section over the currently selected text
            mxDocText.insertTextContent ( mxDocCursor, mxFishSection, true );
           
            // Get the wonderful XRelativeTextContentInsert interface
            XRelativeTextContentInsert xRelative = (XRelativeTextContentInsert )
                UnoRuntime.queryInterface (
                    XRelativeTextContentInsert.class, mxDocText );
           
            // Create a new empty paragraph and get it's XTextContent interface
            XTextContent xNewPara = (XTextContent) UnoRuntime.queryInterface(
                XTextContent.class,
                mxDocFactory.createInstance("com.sun.star.text.Paragraph"));

            // Insert the empty paragraph after the fish Text Section
            xRelative.insertTextContentAfter ( xNewPara, mxFishSection );
        }
        catch (Exception e)
        {
            e.printStackTrace();
        }
View Full Code Here

Examples of com.sun.star.text.XRelativeTextContentInsert

            try
            {
                    // Go to the end of the document
                    mxDocCursor.gotoEnd( false );
                    // Get the RelativeTextContentInsert interface of the document
                    XRelativeTextContentInsert xRelative =
                                    (XRelativeTextContentInsert ) UnoRuntime.queryInterface (
                                             XRelativeTextContentInsert.class, mxDocText );

                    // Use the document's factory to create the NumberingRules service, and get it's
                    // XIndexAccess interface
                    XIndexAccess xNum = (XIndexAccess) UnoRuntime.queryInterface( XIndexAccess.class,
                                    mxDocFactory.createInstance( "com.sun.star.text.NumberingRules" ) );

                    // Also get the NumberingRule's XIndexReplace interface
                    XIndexReplace xReplace = (XIndexReplace) UnoRuntime.queryInterface(
                            XIndexReplace.class, xNum );

                    // Create an array of XPropertySets, one for each of the three paragraphs we're about
                    // to create
                    XPropertySet xParas[] = new XPropertySet [ 3 ];
                    for ( int i = 0 ; i < 3 ; ++ i )
                    {
                            // Create a new paragraph
                            XTextContent xNewPara = (XTextContent) UnoRuntime.queryInterface(
                                    XTextContent.class, mxDocFactory.createInstance(
                                            "com.sun.star.text.Paragraph" ) );

                            // Get the XPropertySet interface of the new paragraph and put it in our array
                            xParas[i] = (XPropertySet) UnoRuntime.queryInterface(
                                    XPropertySet.class, xNewPara );

                            // Insert the new paragraph into the document after the fish section. As it is
                            // an insert
                            // relative to the fish section, the first paragraph inserted will be below
                            // the next two
                            xRelative.insertTextContentAfter ( xNewPara, mxFishSection );

                            // Separate from the above, but also needs to be done three times

                            // Get the PropertyValue sequence for this numbering level
                            PropertyValue [] aProps = (PropertyValue [] ) xNum.getByIndex ( i );
View Full Code Here

Examples of com.sun.star.text.XRelativeTextContentInsert

                    // Insert the 'Fish' section over the currently selected text
                    mxDocText.insertTextContent ( mxDocCursor, mxFishSection, true );

                    // Get the wonderful XRelativeTextContentInsert interface
                    XRelativeTextContentInsert xRelative = (XRelativeTextContentInsert )
                            UnoRuntime.queryInterface (
                                     XRelativeTextContentInsert.class, mxDocText );

                    // Create a new empty paragraph and get it's XTextContent interface
                    XTextContent xNewPara = (XTextContent) UnoRuntime.queryInterface( XTextContent.class,
                            mxDocFactory.createInstance( "com.sun.star.text.Paragraph" ) );

                    // Insert the empty paragraph after the fish Text Section
                    xRelative.insertTextContentAfter ( xNewPara, mxFishSection );
            }
            catch (Exception e)
            {
                    e.printStackTrace ( System.out );
            }
View Full Code Here

Examples of com.sun.star.text.XRelativeTextContentInsert

        try
        {
            // Go to the end of the document
            mxDocCursor.gotoEnd( false );
            // Get the RelativeTextContentInsert interface of the document
            XRelativeTextContentInsert xRelative =
                (XRelativeTextContentInsert ) UnoRuntime.queryInterface (
                    XRelativeTextContentInsert.class, mxDocText );

            // Use the document's factory to create the NumberingRules service,
            // and get it's XIndexAccess interface
            XIndexAccess xNum = (XIndexAccess) UnoRuntime.queryInterface(
                XIndexAccess.class,
                mxDocFactory.createInstance( "com.sun.star.text.NumberingRules" ) );

            // Also get the NumberingRule's XIndexReplace interface
            XIndexReplace xReplace = (XIndexReplace) UnoRuntime.queryInterface(
                XIndexReplace.class, xNum );

            // Create an array of XPropertySets, one for each of the three
            // paragraphs we're about to create
            XPropertySet xParas[] = new XPropertySet [ 3 ];
            for ( int i = 0 ; i < 3 ; ++ i )
            {
                // Create a new paragraph
                XTextContent xNewPara = (XTextContent) UnoRuntime.queryInterface(
                    XTextContent.class, mxDocFactory.createInstance(
                        "com.sun.star.text.Paragraph" ) );
               
                // Get the XPropertySet interface of the new paragraph and put
                // it in our array
                xParas[i] = (XPropertySet) UnoRuntime.queryInterface(
                    XPropertySet.class, xNewPara );

                // Insert the new paragraph into the document after the fish
                // section. As it is an insert relative to the fish section, the
                // first paragraph inserted will be below the next two
                xRelative.insertTextContentAfter ( xNewPara, mxFishSection );

                // Separate from the above, but also needs to be done three times

                // Get the PropertyValue sequence for this numbering level
                PropertyValue [] aProps = (PropertyValue [] ) xNum.getByIndex ( i );
View Full Code Here

Examples of com.sun.star.text.XRelativeTextContentInsert

           
            // Insert the 'Fish' section over the currently selected text
            mxDocText.insertTextContent ( mxDocCursor, mxFishSection, true );
           
            // Get the wonderful XRelativeTextContentInsert interface
            XRelativeTextContentInsert xRelative = (XRelativeTextContentInsert )
                UnoRuntime.queryInterface (
                    XRelativeTextContentInsert.class, mxDocText );
           
            // Create a new empty paragraph and get it's XTextContent interface
            XTextContent xNewPara = (XTextContent) UnoRuntime.queryInterface(
                XTextContent.class,
                mxDocFactory.createInstance("com.sun.star.text.Paragraph"));

            // Insert the empty paragraph after the fish Text Section
            xRelative.insertTextContentAfter ( xNewPara, mxFishSection );
        }
        catch (Exception e)
        {
            e.printStackTrace();
        }
View Full Code Here

Examples of com.sun.star.text.XRelativeTextContentInsert

        try
        {
            // Go to the end of the document
            mxDocCursor.gotoEnd( false );
            // Get the RelativeTextContentInsert interface of the document
            XRelativeTextContentInsert xRelative =
                (XRelativeTextContentInsert ) UnoRuntime.queryInterface (
                    XRelativeTextContentInsert.class, mxDocText );

            // Use the document's factory to create the NumberingRules service,
            // and get it's XIndexAccess interface
            XIndexAccess xNum = (XIndexAccess) UnoRuntime.queryInterface(
                XIndexAccess.class,
                mxDocFactory.createInstance( "com.sun.star.text.NumberingRules" ) );

            // Also get the NumberingRule's XIndexReplace interface
            XIndexReplace xReplace = (XIndexReplace) UnoRuntime.queryInterface(
                XIndexReplace.class, xNum );

            // Create an array of XPropertySets, one for each of the three
            // paragraphs we're about to create
            XPropertySet xParas[] = new XPropertySet [ 3 ];
            for ( int i = 0 ; i < 3 ; ++ i )
            {
                // Create a new paragraph
                XTextContent xNewPara = (XTextContent) UnoRuntime.queryInterface(
                    XTextContent.class, mxDocFactory.createInstance(
                        "com.sun.star.text.Paragraph" ) );
               
                // Get the XPropertySet interface of the new paragraph and put
                // it in our array
                xParas[i] = (XPropertySet) UnoRuntime.queryInterface(
                    XPropertySet.class, xNewPara );

                // Insert the new paragraph into the document after the fish
                // section. As it is an insert relative to the fish section, the
                // first paragraph inserted will be below the next two
                xRelative.insertTextContentAfter ( xNewPara, mxFishSection );

                // Separate from the above, but also needs to be done three times

                // Get the PropertyValue sequence for this numbering level
                PropertyValue [] aProps = (PropertyValue [] ) xNum.getByIndex ( i );
View Full Code Here

Examples of com.sun.star.text.XRelativeTextContentInsert

           
            // Insert the 'Fish' section over the currently selected text
            mxDocText.insertTextContent ( mxDocCursor, mxFishSection, true );
           
            // Get the wonderful XRelativeTextContentInsert interface
            XRelativeTextContentInsert xRelative = (XRelativeTextContentInsert )
                UnoRuntime.queryInterface (
                    XRelativeTextContentInsert.class, mxDocText );
           
            // Create a new empty paragraph and get it's XTextContent interface
            XTextContent xNewPara = (XTextContent) UnoRuntime.queryInterface(
                XTextContent.class,
                mxDocFactory.createInstance("com.sun.star.text.Paragraph"));

            // Insert the empty paragraph after the fish Text Section
            xRelative.insertTextContentAfter ( xNewPara, mxFishSection );
        }
        catch (Exception e)
        {
            e.printStackTrace();
        }
View Full Code Here

Examples of com.sun.star.text.XRelativeTextContentInsert

            try
            {
                    // Go to the end of the document
                    mxDocCursor.gotoEnd( false );
                    // Get the RelativeTextContentInsert interface of the document
                    XRelativeTextContentInsert xRelative =
                                    (XRelativeTextContentInsert ) UnoRuntime.queryInterface (
                                             XRelativeTextContentInsert.class, mxDocText );

                    // Use the document's factory to create the NumberingRules service, and get it's
                    // XIndexAccess interface
                    XIndexAccess xNum = (XIndexAccess) UnoRuntime.queryInterface( XIndexAccess.class,
                                    mxDocFactory.createInstance( "com.sun.star.text.NumberingRules" ) );

                    // Also get the NumberingRule's XIndexReplace interface
                    XIndexReplace xReplace = (XIndexReplace) UnoRuntime.queryInterface(
                            XIndexReplace.class, xNum );

                    // Create an array of XPropertySets, one for each of the three paragraphs we're about
                    // to create
                    XPropertySet xParas[] = new XPropertySet [ 3 ];
                    for ( int i = 0 ; i < 3 ; ++ i )
                    {
                            // Create a new paragraph
                            XTextContent xNewPara = (XTextContent) UnoRuntime.queryInterface(
                                    XTextContent.class, mxDocFactory.createInstance(
                                            "com.sun.star.text.Paragraph" ) );

                            // Get the XPropertySet interface of the new paragraph and put it in our array
                            xParas[i] = (XPropertySet) UnoRuntime.queryInterface(
                                    XPropertySet.class, xNewPara );

                            // Insert the new paragraph into the document after the fish section. As it is
                            // an insert
                            // relative to the fish section, the first paragraph inserted will be below
                            // the next two
                            xRelative.insertTextContentAfter ( xNewPara, mxFishSection );

                            // Separate from the above, but also needs to be done three times

                            // Get the PropertyValue sequence for this numbering level
                            PropertyValue [] aProps = (PropertyValue [] ) xNum.getByIndex ( i );
View Full Code Here

Examples of com.sun.star.text.XRelativeTextContentInsert

                    // Insert the 'Fish' section over the currently selected text
                    mxDocText.insertTextContent ( mxDocCursor, mxFishSection, true );

                    // Get the wonderful XRelativeTextContentInsert interface
                    XRelativeTextContentInsert xRelative = (XRelativeTextContentInsert )
                            UnoRuntime.queryInterface (
                                     XRelativeTextContentInsert.class, mxDocText );

                    // Create a new empty paragraph and get it's XTextContent interface
                    XTextContent xNewPara = (XTextContent) UnoRuntime.queryInterface( XTextContent.class,
                            mxDocFactory.createInstance( "com.sun.star.text.Paragraph" ) );

                    // Insert the empty paragraph after the fish Text Section
                    xRelative.insertTextContentAfter ( xNewPara, mxFishSection );
            }
            catch (Exception e)
            {
                    e.printStackTrace ( System.out );
            }
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.