Package ag.ion.bion.officelayer.internal.text.table

Examples of ag.ion.bion.officelayer.internal.text.table.TextTableCellReference


  public void testTextTableFormulaModel2() {
    try {
      TextTableFormulaExpression textTableFormulaExpression = new TextTableFormulaExpression(
          "<A1>+<b2>");
      TextTableCellReference[] references = new TextTableCellReference[3];
      TextTableCellReference reference1 = new TextTableCellReference(
          "<D6>");
      TextTableCellReference reference2 = new TextTableCellReference(
          "<E6>");
      TextTableCellReference reference3 = new TextTableCellReference(
          "<F6>");
      references[0] = reference1;
      references[1] = reference2;
      references[2] = reference3;
      TextTableFormulaModel formulaModel = new TextTableFormulaModel(
          textTableFormulaExpression);
      TextTableCellReference cellReference = formulaModel
          .getCellReferences()[0];
      formulaModel.replaceCellReference(cellReference, references);
      references = formulaModel.getCellReferences();
      Assert.assertEquals(4, references.length);
      Assert.assertEquals("(<D6>+<E6>+<F6>)+<b2>", formulaModel
View Full Code Here


      IETextTableCell startCell = textTable.getCell(startRowIndex,
          startColumnIndex);
      IETextTableCell endCell = textTable.getCell(endRowIndex,
          endColumnIndex);
      String formula = "";
      TextTableCellReference textTableCellReference = null;

      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);

      TextTableCellReference[] references = new TextTableCellReference[newTextTableCellReferences
          .size()];
      references = (TextTableCellReference[]) newTextTableCellReferences
View Full Code Here

TOP

Related Classes of ag.ion.bion.officelayer.internal.text.table.TextTableCellReference

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.