+ "indicating column-width: "
+ this.table.getContextMessage());
return Status.OK;
}
final TableArea tableArea = bcArea.makeTableArea(this.table,
graftingPoint);
Status status = null;
/* Process the table header if we are on the first page/column, or if
* we are not to omit at breaks. */
if (tableArea.isFirstChildOfGeneratedBy()
|| ! this.table.traitTableOmitHeaderAtBreak(tableArea)) {
status = layoutTableHeader(tableArea, graftingPoint);
if (status.isIncomplete()) {
this.resetAll(tableArea);
return Status.AREA_FULL_NONE;
}
}
/* See if the table footer will fit.
* We don't really want the footer to come before the body, but the
* AreaTree is responsible to keep the order and position of the
* Areas correct. */
status = layoutTableFooter(tableArea, graftingPoint);
if (status.isIncomplete()) {
this.resetAll(tableArea);
return Status.AREA_FULL_NONE;
}
/* Process the table body(s). */
for (int i = getProgress(); i < this.table.getChildCount(); i++) {
final Fo fo = this.table.getChildAt(i);
if (fo instanceof TableBody) {
status = getLayoutProxy(fo).layout(tableArea,
graftingPoint);
if (status.isIncomplete()) {
setProgress(i);
status = Status.AREA_FULL_SOME;
if (this.bodyCount == 0
&& status == Status.AREA_FULL_NONE) {
resetAll(tableArea);
}
return status;
}
this.bodyCount++;
}
}
if (this.table.getTableFooter() != null
&& this.table.traitTableOmitFooterAtBreak(areaNode)) {
final TableFooter tf = this.table.getTableFooter();
final TableFooterPL tfPL = (TableFooterPL) getLayoutProxy(tf);
status = tfPL.layout(tableArea, graftingPoint);
if (status.isIncomplete()) {
// this is a problem since we need to remove a row
// from the last table body and place it on the
// next page so that it can have a footer at
// the end of the table.
getLayout().getLogger().warn("footer could not fit on page, "
+ "moving last body row to next page");
final TableFooterPL tableFooterPL
= (TableFooterPL) this.getLayoutProxy(tf);
final TableFooterContainer footerArea =
tableArea.getTableFooterContainer();
tableArea.removeChild(footerArea);
tableFooterPL.resetProgress();
return Status.AREA_FULL_SOME;
}
}