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

Examples of ag.ion.bion.officelayer.text.table.extended.IETextTableCellRange


  public void addRows(int index, int count) throws TextException {
    if(textTableManagement.getTextTables().length == 1 && textTableManagement.getFirstTextTable().getRowCount() + count < maxRowsInTable) {
      textTableManagement.getFirstTextTable().addRow(index,count);
      return;
    }
    IETextTableCellRange textTableCellRange = getCellRange(0,index,columnCount-1,getRowCount()-1);
    ITextTable textTable = textTableManagement.getLastTextTable();
    IDestinationPosition destinationPosition = new DestinationPosition(textTable);
   
    try {
      ETextTableCellRange tableCellRange = (ETextTableCellRange)textTableCellRange.getCloneService().cloneToPosition(destinationPosition,null).getClonedObject();
      ITextTableCellRange[] textTableCellRanges = tableCellRange.getRanges();
      int tableNumber = getTableNumber(index);
      ITextTable table = textTableManagement.getTextTable(tableNumber);
     
      int rowCount = table.getRowCount()-1;
      int rowIndex = getRowIndexInTable(tableNumber,index);
     
      removeTables(tableNumber+1,textTableManagement.getTextTables().length-tableNumber-1);
     
      ITextTableCellRange textTableCellRangeClone = table.getCellRange(0,rowIndex,columnCount-1,rowIndex);
     
      int help = rowIndex + count - (rowCount+1);
      if(help < 0) {
        for(int i = rowIndex; i <= count; i++) {
          ITextTableCellRange cellRange = table.getCellRange(0,i,columnCount-1,i);
          destinationPosition = new DestinationPosition(cellRange);
          textTableCellRangeClone.getCloneService().cloneToPosition(destinationPosition,null);
        }
        IETextTableCellRange cellRange = getCellRange(0,index,columnCount-1,index+count-1);
        clearTableRange(cellRange);
        table.removeRows(rowIndex+count,rowCount-(rowIndex+count)+1);
      }
      else {
        for(int i = rowIndex; i <= rowCount; i++) {
          ITextTableCellRange cellRange = table.getCellRange(0,i,columnCount-1,i);
          destinationPosition = new DestinationPosition(cellRange);
          textTableCellRangeClone.getCloneService().cloneToPosition(destinationPosition,null);
        }
        IETextTableCellRange cellRange = getCellRange(0,index,columnCount-1,index + (rowCount-rowIndex));
        clearTableRange(cellRange);
        addRowsProperty(help,textTableCellRangeClone);
      }
      for(int i = 0; i < textTableCellRanges.length; i++) {
        textTableManagement.addTextTable(textTableCellRanges[i].getCell(0,0).getTextTable());
View Full Code Here


      textTableCellRanges.add(textTable.getCellRange(firstColumnIndex,0, lastColumnIndex, getRowIndexInTable(lastTableNumber,lastRowIndex)));
    }
    ITextTableCellRange[] tableCellRanges = new ITextTableCellRange[textTableCellRanges.size()];
    tableCellRanges = (ITextTableCellRange[])textTableCellRanges.toArray(tableCellRanges);
    ITextTableCellRangeName tableCellRangeName = new TextTableCellRangeName(firstColumnIndex,firstRowIndex,lastColumnIndex,lastRowIndex);
    IETextTableCellRange tableCellRange = new ETextTableCellRange(tableCellRanges,tableCellRangeName,this);
    return tableCellRange;
  }
View Full Code Here

    ITextTable[] textTables = textTableManagement.getTextTables();
    for(int i = 0; i < textTables.length; i++) {
      ITextTableRow[] textTableRow = textTables[i].getRows();
      IETextTableRow[] rows = new IETextTableRow[textTableRow.length];
      for(int j = 0; j < textTableRow.length-1; j++) {
        IETextTableCellRange textTableCellRange = getCellRange(0,j,columnCount-1,j);
        rows[j] = new ETextTableRow(textTableCellRange,textTableRows.length+2,this);
      }
      try {
        textTableRows = (IETextTableRow[])ArrayUtils.appendArray(textTableRows,rows, IETextTableRow.class);
      }
View Full Code Here

   * @throws TextException if any error occurs
   *
   * @author Miriam Sutter
   */
  public IETextTableRow getRow(int index) throws TextException{
    IETextTableCellRange textTableCellRange = getCellRange(0,index, columnCount-1, index);
    IETextTableRow textTableRow = new ETextTableRow(textTableCellRange,index,this);
    return textTableRow;
  }
View Full Code Here

        table = range[i].getCell(0,0).getTextTable();
        eTextTable.addTable(table);
      }
      if(generateReturnValue) {
        ITextTableCellRangeName textTableCellRangeName = new TextTableCellRangeName(0,0,range[0].getColumnCount()-1,range[0].getRowCount());
        IETextTableCellRange cellRange = new ETextTableCellRange(range,textTableCellRangeName,eTextTable);
        return new ClonedObject(cellRange,cellRange.getClass());
      }
      else
        return null;
    }
    catch(TextException textException) {
View Full Code Here

        && textTableManagement.getFirstTextTable().getRowCount()
            + count < maxRowsInTable) {
      textTableManagement.getFirstTextTable().addRow(index, count);
      return;
    }
    IETextTableCellRange textTableCellRange = getCellRange(0, index,
        columnCount - 1, getRowCount() - 1);
    ITextTable textTable = textTableManagement.getLastTextTable();
    IDestinationPosition destinationPosition = new DestinationPosition(
        textTable);

    try {
      ETextTableCellRange tableCellRange = (ETextTableCellRange) textTableCellRange
          .getCloneService().cloneToPosition(destinationPosition,
              null).getClonedObject();
      ITextTableCellRange[] textTableCellRanges = tableCellRange
          .getRanges();
      int tableNumber = getTableNumber(index);
      ITextTable table = textTableManagement.getTextTable(tableNumber);

      int rowCount = table.getRowCount() - 1;
      int rowIndex = getRowIndexInTable(tableNumber, index);

      removeTables(tableNumber + 1,
          textTableManagement.getTextTables().length - tableNumber
              - 1);

      ITextTableCellRange textTableCellRangeClone = table.getCellRange(0,
          rowIndex, columnCount - 1, rowIndex);

      int help = rowIndex + count - (rowCount + 1);
      if (help < 0) {
        for (int i = rowIndex; i <= count; i++) {
          ITextTableCellRange cellRange = table.getCellRange(0, i,
              columnCount - 1, i);
          destinationPosition = new DestinationPosition(cellRange);
          textTableCellRangeClone.getCloneService().cloneToPosition(
              destinationPosition, null);
        }
        IETextTableCellRange cellRange = getCellRange(0, index,
            columnCount - 1, index + count - 1);
        clearTableRange(cellRange);
        table.removeRows(rowIndex + count, rowCount
            - (rowIndex + count) + 1);
      } else {
        for (int i = rowIndex; i <= rowCount; i++) {
          ITextTableCellRange cellRange = table.getCellRange(0, i,
              columnCount - 1, i);
          destinationPosition = new DestinationPosition(cellRange);
          textTableCellRangeClone.getCloneService().cloneToPosition(
              destinationPosition, null);
        }
        IETextTableCellRange cellRange = getCellRange(0, index,
            columnCount - 1, index + (rowCount - rowIndex));
        clearTableRange(cellRange);
        addRowsProperty(help, textTableCellRangeClone);
      }
      for (int i = 0; i < textTableCellRanges.length; i++) {
View Full Code Here

        .size()];
    tableCellRanges = (ITextTableCellRange[]) textTableCellRanges
        .toArray(tableCellRanges);
    ITextTableCellRangeName tableCellRangeName = new TextTableCellRangeName(
        firstColumnIndex, firstRowIndex, lastColumnIndex, lastRowIndex);
    IETextTableCellRange tableCellRange = new ETextTableCellRange(
        tableCellRanges, tableCellRangeName, this);
    return tableCellRange;
  }
View Full Code Here

    ITextTable[] textTables = textTableManagement.getTextTables();
    for (int i = 0; i < textTables.length; i++) {
      ITextTableRow[] textTableRow = textTables[i].getRows();
      IETextTableRow[] rows = new IETextTableRow[textTableRow.length];
      for (int j = 0; j < textTableRow.length - 1; j++) {
        IETextTableCellRange textTableCellRange = getCellRange(0, j,
            columnCount - 1, j);
        rows[j] = new ETextTableRow(textTableCellRange,
            textTableRows.length + 2, this);
      }
      try {
View Full Code Here

   *             if any error occurs
   *
   * @author Miriam Sutter
   */
  public IETextTableRow getRow(int index) throws TextException {
    IETextTableCellRange textTableCellRange = getCellRange(0, index,
        columnCount - 1, index);
    IETextTableRow textTableRow = new ETextTableRow(textTableCellRange,
        index, this);
    return textTableRow;
  }
View Full Code Here

      }
      if (generateReturnValue) {
        ITextTableCellRangeName textTableCellRangeName = new TextTableCellRangeName(
            0, 0, range[0].getColumnCount() - 1, range[0]
                .getRowCount());
        IETextTableCellRange cellRange = new ETextTableCellRange(range,
            textTableCellRangeName, eTextTable);
        return new ClonedObject(cellRange, cellRange.getClass());
      } else
        return null;
    } catch (TextException textException) {
      CloneException cloneException = new CloneException(
          "Error while cloning table");
View Full Code Here

TOP

Related Classes of ag.ion.bion.officelayer.text.table.extended.IETextTableCellRange

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.