Package com.sun.star.text

Examples of com.sun.star.text.XTextTable.initialize()


        } else {
          Object object = xMultiServiceFactory
          .createInstance("com.sun.star.text.TextTable");
          XTextTable xTable = (XTextTable) UnoRuntime.queryInterface(
              XTextTable.class, object);
          xTable.initialize(1, 1);
          xText.insertTextContent(textContent.getXTextContent()
              .getAnchor(), xTable, false);
          xRelativeTextContentInsert.insertTextContentAfter(
              newTextContent.getXTextContent(), xTable);
          xText.removeTextContent(xTable);
View Full Code Here


  public void insertTextContent(ITextRange textRange, ITextContent textContent) throws TextException {
    try {
      if (textContent instanceof IParagraph) {
        Object object = xMultiServiceFactory.createInstance("com.sun.star.text.TextTable");
        XTextTable xTable = (XTextTable)UnoRuntime.queryInterface(XTextTable.class, object);
        xTable.initialize(1,1);
        xText.insertTextContent(textRange.getXTextRange(), xTable, false);
        XRelativeTextContentInsert xRelativeTextContentInsert = (XRelativeTextContentInsert)UnoRuntime.queryInterface(XRelativeTextContentInsert.class, xText);
        xRelativeTextContentInsert.insertTextContentAfter(textContent.getXTextContent(), xTable);
        xText.removeTextContent(xTable);
      }
View Full Code Here

          xRelativeTextContentInsert.insertTextContentAfter(newXTextContent, oldXTextContent);
        }
        else {
          Object object = xMultiServiceFactory.createInstance("com.sun.star.text.TextTable");
          XTextTable xTable = (XTextTable)UnoRuntime.queryInterface(XTextTable.class, object);
          xTable.initialize(1,1);
          xText.insertTextContent(textContent.getXTextContent().getAnchor(), xTable, false);
          xRelativeTextContentInsert.insertTextContentAfter(newTextContent.getXTextContent(), xTable);
          xText.removeTextContent(xTable);
        }
      }
View Full Code Here

    }
    try {
      XMultiServiceFactory xMultiServiceFactory = (XMultiServiceFactory)UnoRuntime.queryInterface(XMultiServiceFactory.class, textDocument.getXTextDocument());
      Object newTable = xMultiServiceFactory.createInstance("com.sun.star.text.TextTable");
      XTextTable newTextTable = (XTextTable)UnoRuntime.queryInterface(XTextTable.class, newTable);
      newTextTable.initialize(rows,columns);
     
      TextTable textTable = new TextTable(textDocument, newTextTable);
      return textTable;
    }
    catch(Exception exception) {
View Full Code Here

      if (textContent instanceof IParagraph) {
        Object object = xMultiServiceFactory
            .createInstance("com.sun.star.text.TextTable");
        XTextTable xTable = (XTextTable) UnoRuntime.queryInterface(
            XTextTable.class, object);
        xTable.initialize(1, 1);
        xText.insertTextContent(textRange.getXTextRange(), xTable,
            false);
        XRelativeTextContentInsert xRelativeTextContentInsert = (XRelativeTextContentInsert) UnoRuntime
            .queryInterface(XRelativeTextContentInsert.class, xText);
        xRelativeTextContentInsert.insertTextContentAfter(textContent
View Full Code Here

        } else {
          Object object = xMultiServiceFactory
              .createInstance("com.sun.star.text.TextTable");
          XTextTable xTable = (XTextTable) UnoRuntime.queryInterface(
              XTextTable.class, object);
          xTable.initialize(1, 1);
          xText.insertTextContent(textContent.getXTextContent()
              .getAnchor(), xTable, false);
          xRelativeTextContentInsert.insertTextContentAfter(
              newTextContent.getXTextContent(), xTable);
          xText.removeTextContent(xTable);
View Full Code Here

            XTextTable xTable = (XTextTable) UnoRuntime.queryInterface(
                XTextTable.class, mxDocFactory .createInstance(
                    "com.sun.star.text.TextTable" ) );
           
            // Specify that we want the table to have 4 rows and 4 columns
            xTable.initialize( 4, 4 );
           
            // Insert the table into the document
            mxDocText.insertTextContent( mxDocCursor, xTable, false);
            // Get an XIndexAccess of the table rows
            XIndexAccess xRows = xTable.getRows();
View Full Code Here

            // Make sure we have at least one group name
            if ( aGroupNames.length > 0 )
            {
                // initialise the table to have a row for every autotext group
                // in a single column + one additional row for a header
                xTable.initialize( aGroupNames.length+1,1);

                // Access the XPropertySet of the table
                XPropertySet xTableProps = (XPropertySet)UnoRuntime.queryInterface(
                    XPropertySet.class, xTable );
               
View Full Code Here

        documentText.insertString( textCursor, "text field, and vice versa.\n", false );

        XTextTable table = (XTextTable)UnoRuntime.queryInterface( XTextTable.class,
            m_document.createInstance( "com.sun.star.text.TextTable" )
        );
        table.initialize( 1, 1 );
        documentText.insertTextContent( textCursor, table, false );

        // insert our sample control
        XPropertySet textControl = m_formLayer.insertControlLine( "DatabaseTextField", "enter some text", "", 30 );
View Full Code Here

            XTextTable xTable = (XTextTable) UnoRuntime.queryInterface(
                XTextTable.class, mxDocFactory .createInstance(
                    "com.sun.star.text.TextTable" ) );
           
            // Specify that we want the table to have 4 rows and 4 columns
            xTable.initialize( 4, 4 );
           
            // Insert the table into the document
            mxDocText.insertTextContent( mxDocCursor, xTable, false);
            // Get an XIndexAccess of the table rows
            XIndexAccess xRows = xTable.getRows();
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.