Package ag.ion.bion.officelayer.text

Examples of ag.ion.bion.officelayer.text.ITextTable


        range = (ITextRange) position.getDestinationObject();
      }
      ITextDocument textDocument = textTable.getTextDocument();
      ITextContentService textContentService = textDocument
          .getTextService().getTextContentService();
      ITextTable newTable = textDocument.getTextTableService()
          .constructTextTable(tablePropertyStore.getRows(),
              tablePropertyStore.getColumns());

      if (range != null) {
        textContentService.insertTextContent(range, newTable);
      } else {
        textContentService.insertTextContentAfter(newTable, textTable);
      }

      String[] propertyKeysToCopy = null;
      if (propertyKeysContainer != null) {
        propertyKeysToCopy = propertyKeysContainer
            .getPropertyKeys(ITextTableProperties.TYPE_ID);
      } else {
        // use default
        propertyKeysToCopy = TextTableProperties
            .getDefaultPropertyKeys();
      }
      if (propertyKeysToCopy != null) {
        ITextTableProperties newTableProperties = newTable
            .getProperties();
        ((IPropertyStore) tablePropertyStore).getProperties().copyTo(
            propertyKeysToCopy, newTableProperties);
      }

      int rowArrayLength = cellCloneServices.length;
      for (int rows = 0; rows < rowArrayLength; rows++) {
        // set row height
        newTable.getRow(rows).setHeight(
            textTable.getRow(rows).getHeight());
        newTable.getRow(rows).setAutoHeight(
            textTable.getRow(rows).getAutoHeight());

        int columnArrayLength = cellCloneServices[rows].length;
        for (int columns = 0; columns < columnArrayLength; columns++) {
          ICloneService cellClone = cellCloneServices[rows][columns];
          ITextTableCell textTableCell = newTable.getCell(columns,
              rows);
          CloneDestinationPosition destinationCell = new CloneDestinationPosition(
              textTableCell, textTableCell.getClass());
          cellClone.cloneToPositionNoReturn(destinationCell,
              adoptContent, propertyKeysContainer);
        }
      }

      if (createSpace) {
        IParagraph paragraph = textContentService
            .constructNewParagraph();
        textContentService.insertTextContentBefore(paragraph, newTable);
      }
      if (generateReturnValue)
        return new ClonedObject(newTable, newTable.getClass());
      else
        return null;
    } catch (Exception exception) {
      CloneException cloneException = new CloneException(exception
          .getMessage());
View Full Code Here


      int startTableIndex = textTable.getTextTableIndex(startCell
          .getTableCell().getTextTable());
      int endTableIndex = textTable.getTextTableIndex(endCell
          .getTableCell().getTextTable());

      ITextTable table = textTable.getTextTable(startTableIndex);
      if (!startCell.getName().getName().equals(
          endCell.getName().getName())) {

        if (startTableIndex != endTableIndex) {
          formula = table.getName()
              + "."
              + startCell.getTableCell().getName().getName()
              + ":"
              + table.getCell(endColumnIndex,
                  table.getRowCount() - 1).getName()
                  .getName();
          textTableCellReference = new TextTableCellReference(formula);
          newTextTableCellReferences.add(textTableCellReference);
          for (int j = startTableIndex + 1; j < endTableIndex; j++) {
            table = textTable.getTextTable(j);
            formula = table.getName()
                + "."
                + TextTableCellNameHelper
                    .getColumnCharacter(startCell.getName()
                        .getColumnIndex())
                + "1"
                + ":"
                + table.getCell(endColumnIndex,
                    table.getRowCount() - 1).getName()
                    .getName();
            textTableCellReference = new TextTableCellReference(
                formula);
            newTextTableCellReferences.add(textTableCellReference);
          }

          table = textTable.getTextTable(endTableIndex);
          formula = table.getName()
              + "."
              + TextTableCellNameHelper
                  .getColumnCharacter(startCell.getName()
                      .getColumnIndex()) + "1" + ":"
              + endCell.getTableCell().getName().getName();
        } else {
          formula = table.getName() + "."
              + startCell.getTableCell().getName().getName()
              + ":" + endCell.getTableCell().getName().getName();
        }
      } else {
        formula = table.getName() + "."
            + startCell.getTableCell().getName().getName();
      }
      textTableCellReference = new TextTableCellReference(formula);
      newTextTableCellReferences.add(textTableCellReference);
View Full Code Here

TOP

Related Classes of ag.ion.bion.officelayer.text.ITextTable

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.