int pos = insertPosition[i]; CellHandle cell = contextInfo.getCell( ).handle( adapter.getModule( ) );
int pos; if ( insertPosition == null ) pos = adapter.findCellPosition( row, columnIndex, isInsert ); else pos = insertPosition[i];
	protected void pasteCells( List copiedCells, List originalCells,			int columnIndex, boolean isInsert ) throws SemanticException	{		// insert column index that is from 1. this must happen before removing		// operation.		int[] insertPosition = getInsertPosition( copiedCells, originalCells,				columnIndex, isInsert );		// remove cells first.		for ( int i = 0; !isInsert && i < originalCells.size( ); i++ )		{			CellContextInfo contextInfo = (CellContextInfo) originalCells					.get( i );			CellHandle cell = contextInfo.getCell( ).handle(					adapter.getModule( ) );			if ( !isInsert )				cell.getContainerSlotHandle( ).drop( cell );		}		// adds the copied cells to the destination.		for ( int i = 0; i < copiedCells.size( ); i++ )		{			CellContextInfo contextInfo = (CellContextInfo) copiedCells.get( i );			// groupId is equal to -1, means this is a top slot in the table			RowHandle row = adapter.getRow( contextInfo.getSlotId( ),					contextInfo.getGroupId( ), contextInfo.getRowIndex( ) );			assert row != null;			int pos = insertPosition[i];			CellHandle cell = contextInfo.getCell( ).handle(					adapter.getModule( ) );			// to avoid duplicate names in the same name space, rename nested			// elements here.			adapter.getModule( ).getModuleHandle( ).rename( cell );			// if this is only paste operation, then paste it to the old			// position. Otherwise, append it to the next available position.			if ( !isInsert )				pos--;			if ( pos != -1 )				row.addElement( cell, TableRow.CONTENT_SLOT, pos );			else				row.addElement( cell, TableRow.CONTENT_SLOT );		}	}