private void importCell(Cell cell) {
        this.content = new ArrayList();
        
        if(cell == null) {
            this.borders = new RtfBorderGroup(this.document, RtfBorder.CELL_BORDER, this.parentRow.getParentTable().getBorders());
            return;
        }
        
        this.colspan = cell.getColspan();
        this.rowspan = cell.getRowspan();
        if(cell.getRowspan() > 1) {
            this.mergeType = MERGE_VERT_PARENT;
        }
        if(cell instanceof RtfCell) {
            this.borders = new RtfBorderGroup(this.document, RtfBorder.CELL_BORDER, ((RtfCell) cell).getBorders());
        } else {
            this.borders = new RtfBorderGroup(this.document, RtfBorder.CELL_BORDER, cell.getBorder(), cell.getBorderWidth(), cell.getBorderColor());
        }
        this.verticalAlignment = cell.getVerticalAlignment();
        if(cell.getBackgroundColor() == null) {
            this.backgroundColor = new RtfColor(this.document, 255, 255, 255);
        } else {
            this.backgroundColor = new RtfColor(this.document, cell.getBackgroundColor());
        }
        
        this.cellPadding = (int) this.parentRow.getParentTable().getCellPadding();
        
        Iterator cellIterator = cell.getElements();
        Paragraph container = null;
        while(cellIterator.hasNext()) {
            try {
                Element element = (Element) cellIterator.next();
                // should we wrap it in a paragraph
                if(!(element instanceof Paragraph) && !(element instanceof List)) {
                    if(container != null) {
                        container.add(element);
                    } else {
                        container = new Paragraph();
                        container.setAlignment(cell.getHorizontalAlignment());
                        container.add(element);
                    }
                } else {
                    if(container != null) {
                        RtfBasicElement[] rtfElements = this.document.getMapper().mapElement(container);
                        for(int i = 0; i < rtfElements.length; i++) {
                            rtfElements[i].setInTable(true);
                            this.content.add(rtfElements[i]);
                        }
                        container = null;
                    }
                    // if horizontal alignment is undefined overwrite
                    // with that of enclosing cell
                    if (element instanceof Paragraph && ((Paragraph) element).getAlignment() == Element.ALIGN_UNDEFINED) {
                        ((Paragraph) element).setAlignment(cell.getHorizontalAlignment());
                    }

                    RtfBasicElement[] rtfElements = this.document.getMapper().mapElement(element);
                    for(int i = 0; i < rtfElements.length; i++) {
                        rtfElements[i].setInTable(true);
                        this.content.add(rtfElements[i]);
                    }
                }
            } catch(DocumentException de) {
                de.printStackTrace();
            }
        }
        if(container != null) {
            try {
                RtfBasicElement[] rtfElements = this.document.getMapper().mapElement(container);
                for(int i = 0; i < rtfElements.length; i++) {
                    rtfElements[i].setInTable(true);
                    this.content.add(rtfElements[i]);
                }
            } catch(DocumentException de) {
                de.printStackTrace();
            }
        }
    }
private void importCell ( Cell cell ) { this . content = new ArrayList ( ) ; if ( cell == null ) { this . borders = new RtfBorderGroup ( this . document , RtfBorder . CELL_BORDER , this . parentRow . getParentTable ( ) . getBorders ( ) ) ; return ; } this . colspan = cell . getColspan ( ) ; this . rowspan = cell . getRowspan ( ) ; if ( cell . getRowspan ( ) > 1 ) { this . mergeType = MERGE_VERT_PARENT ; } if ( cell instanceof RtfCell ) { this . borders = new RtfBorderGroup ( this . document , RtfBorder . CELL_BORDER , ( ( RtfCell ) cell ) . getBorders ( ) ) ; } else { this . borders = new RtfBorderGroup ( this . document , RtfBorder . CELL_BORDER , cell . getBorder ( ) , cell . getBorderWidth ( ) , cell . getBorderColor ( ) ) ; } this . verticalAlignment = cell . getVerticalAlignment ( ) ; if ( cell . getBackgroundColor ( ) == null ) { this . backgroundColor = new RtfColor ( this . document , 255 , 255 , 255 ) ; } else { this . backgroundColor = new RtfColor ( this . document , cell . getBackgroundColor ( ) ) ; } this . cellPadding = ( int ) this . parentRow . getParentTable ( ) . getCellPadding ( ) ; Iterator cellIterator = cell . getElements ( ) ; Paragraph container = null ; while ( cellIterator . hasNext ( ) ) { try { Element element = ( Element ) cellIterator . next ( ) ; if ( ! ( element instanceof Paragraph ) && ! ( element instanceof List ) ) { if ( container != null ) { container . add ( element ) ; } else { container = new Paragraph ( ) ; container . setAlignment ( cell . getHorizontalAlignment ( ) ) ; container . add ( element ) ; } } else { if ( container != null ) { RtfBasicElement [ ] rtfElements = this . document . getMapper ( ) . mapElement ( container ) ; for ( int i = 0 ; i < rtfElements . length ; i ++ ) { rtfElements [ i ] . setInTable ( true ) ; this . content . add ( rtfElements [ i ] ) ; } container = null ; } if ( element instanceof Paragraph && ( ( Paragraph ) element ) . getAlignment ( ) == Element . ALIGN_UNDEFINED ) { ( ( Paragraph ) element ) . setAlignment ( cell . getHorizontalAlignment ( ) ) ; } RtfBasicElement [ ] rtfElements = this . document . getMapper ( ) . mapElement ( element ) ; for ( int i = 0 ; i < rtfElements . length ; i ++ ) { rtfElements [ i ] . setInTable ( true ) ; this . content . add ( rtfElements [ i ] ) ; } } } catch ( DocumentException de ) { de . printStackTrace ( ) ; } } if ( container != null ) { try { RtfBasicElement [ ] rtfElements = this . document . getMapper ( ) . mapElement ( container ) ; for ( int i = 0 ; i < rtfElements . length ; i ++ ) { rtfElements [ i ] . setInTable ( true ) ; this . content . add ( rtfElements [ i ] ) ; } } catch ( DocumentException de ) { de . printStackTrace ( ) ; } } }
Imports the Cell properties into the RtfCell

@param cell The Cell to import