if (p instanceof Array) {
Array array = (Array) p ;
if (array.getCount() <= 0) {
continue ;
}// if
Row firstRow = array.iterator().next() ;
boolean isHeaderRow = true ;
for(Iterator<Cell> iter = firstRow.iterator(); iter.hasNext() && isHeaderRow; ) {
Cell cell = iter.next() ;
for(Iterator<Paragraph> cellIter = cell.iterator(); cellIter.hasNext() && isHeaderRow; ) {
Paragraph paragraph = cellIter.next() ;
if (paragraph instanceof TextParagraph) {
TextParagraph tp = (TextParagraph) paragraph ;
for(Iterator<TextParagraphElement> tpIter = tp.iterator(); tpIter.hasNext() && isHeaderRow; ) {
TextParagraphElement element = tpIter.next() ;
try {
isHeaderRow = Boolean.TRUE.equals(element.getProperty(ElementPropertiesDefaultNames.FORMAT_BOLD)) ;
} catch (InvalidPropertyException e) {
/* This should not happen. */
}// try
}// for
} else {
try {
isHeaderRow = Boolean.TRUE.equals(p.getProperty(ElementPropertiesDefaultNames.FORMAT_BOLD)) ;
} catch (InvalidPropertyException e) {
/* This should not happen. */
}// try
}// if
}// for
}// for
if (isHeaderRow) {
int nCells = firstRow.getCount() ;
for(int cellIndex=0; cellIndex < nCells; ++cellIndex) {
CellHeader header = new CellHeader(firstRow.getCell(cellIndex)) ;
try {
firstRow.add(header, cellIndex) ;
firstRow.remove(cellIndex+1) ;
} catch (KameleonException e) {/* Never called. */}
}// for
}// if
}// if
}// for