Package com.sun.star.text

Examples of com.sun.star.text.XText.createTextCursor()


                    "P" + nPara + "word" + nBookmark,
                    "P" + nPara + "word" + nBookmark);
                XTextCursor xWordCrsr = xText.createTextCursor();
                xWordCrsr.setString(" ");
            }
            XTextCursor xParaCrsr = xText.createTextCursor();
            XTextRange xParaCrsrAsRange = (XTextRange)UnoRuntime.queryInterface(
                XTextRange.class,
                xParaCrsr);
            xText.insertControlCharacter(xParaCrsrAsRange, com.sun.star.text.ControlCharacter.PARAGRAPH_BREAK, false);
        }
View Full Code Here


            e.printStackTrace(log);
            throw new StatusException( "Couldn't create environment ", e );
        }

        XText oText = xTextDoc.getText();
        XTextCursor oCursor = oText.createTextCursor();
        XPropertySet xProp = (XPropertySet)
            UnoRuntime.queryInterface(XPropertySet.class, oCursor);

        try {
            xProp.setPropertyValue("ParaStyleName", oMyStyle.getName());
View Full Code Here

  static void testWriter(XComponent rCmp) throws IOException {
    XTextDocument rTextDoc = UnoRuntime.queryInterface(XTextDocument.class, rCmp);

    XText rText = UnoRuntime.queryInterface(XText.class, rTextDoc.getText());
    XTextCursor rCursor = UnoRuntime.queryInterface(XTextCursor.class, rText.createTextCursor());
    XTextRange rRange = UnoRuntime.queryInterface(XTextRange.class, rCursor);

    byte pcText[] = new byte[1024];
    pcText[0] = 0;
    System.err.println("pleast type any text\n");
View Full Code Here

   */
  public void setCellParagraphStyle (XTextTable table, int col, int row, String style)
    throws UnknownPropertyException, PropertyVetoException, IllegalArgumentException, WrappedTargetException
  {
    XText xCellText = (XText)(UnoRuntime.queryInterface(XText.class, table.getCellByName(convertToCellName (col, row))));
    XTextCursor textCursor = xCellText.createTextCursor();
    XParagraphCursor xParaCursor = (XParagraphCursor)(UnoRuntime.queryInterface (XParagraphCursor.class, textCursor));
    XPropertySet paraProps = (XPropertySet)(UnoRuntime.queryInterface (XPropertySet.class, xParaCursor));
    paraProps.setPropertyValue ("ParaStyleName", style);
   
  }
View Full Code Here

        Object oFrame1 = null;
        Object oFrame2 = null;
        try {
            XText oText = xTextDoc.getText();
            XTextCursor oCursor = oText.createTextCursor();
            oFrame1 = SOF.createInstance
                (xTextDoc, "com.sun.star.text.TextFrame" );
            first = (XTextFrame)UnoRuntime.queryInterface
                ( XTextFrame.class, oFrame1);
            oText.insertTextContent(oCursor,first, false);
View Full Code Here

            // Access the XText interface of the cell referred to by sCellName 
            XText xCellText = (XText) UnoRuntime.queryInterface(
                    XText.class, xTable.getCellByName ( sCellName ) );

            // create a text cursor from the cells XText interface
            XTextCursor xCellCursor = xCellText.createTextCursor();
            // Get the property set of the cell's TextCursor
            XPropertySet xCellCursorProps = (XPropertySet)UnoRuntime.queryInterface(
                    XPropertySet.class, xCellCursor );

            try
View Full Code Here

                    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 );
                    xFrameText.insertString(
                            xFrameCursor, "\nThe second line in the new text frame.", false );
View Full Code Here

                    // Get the first cell from the table
                    XText xTableText = (XText) UnoRuntime.queryInterface(
                            XText.class, xTable.getCellByName ( "A1" ) );

                    // Get a text cursor for the first cell
                    XTextCursor xTableCursor = xTableText.createTextCursor();

                    // Get the XTextContent interface of the reference mark so we can insert it
                    XTextContent xContent = ( XTextContent ) UnoRuntime.queryInterface (
                            XTextContent.class, xRefMark );
View Full Code Here

     
      // Getting the text
      XText xtext = xtextdocument.getText();
     
      // Getting the cursor on the document
      XTextCursor xtextcursor = xtext.createTextCursor();
     
      // Querying for the interface XTextContent on the GraphicObject
      XTextContent xtextcontent = ( XTextContent )
      UnoRuntime.queryInterface( XTextContent.class, objectGraphic );
     
View Full Code Here

  {
    XText xText = getXText();
    String sText = "";

    if (xText != null) {
      XTextCursor xTextCursor = xText.createTextCursor();
      xTextCursor.gotoStart(false);
      xTextCursor.gotoEnd(true);
      sText = xTextCursor.getString();
    }
    return sText;       
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.