return Status.FORCE_COLUMN_BREAK;
default:
return Status.OK;
}
} else {
ColumnArea colArea = (ColumnArea)area;
switch (properties.get("break-before").getEnum()) {
case BreakBefore.PAGE:
// if first ColumnArea, and empty, return OK
if (!colArea.hasChildren() && (colArea.getColumnIndex() == 1))
return Status.OK;
else
return Status.FORCE_PAGE_BREAK;
case BreakBefore.ODD_PAGE:
// if first ColumnArea, empty, _and_ in odd page,
// return OK
if (!colArea.hasChildren() && (colArea.getColumnIndex() == 1)
&& (colArea.getPage().getNumber() % 2 != 0))
return Status.OK;
else
return Status.FORCE_PAGE_BREAK_ODD;
case BreakBefore.EVEN_PAGE:
// if first ColumnArea, empty, _and_ in even page,
// return OK
if (!colArea.hasChildren() && (colArea.getColumnIndex() == 1)
&& (colArea.getPage().getNumber() % 2 == 0))
return Status.OK;
else
return Status.FORCE_PAGE_BREAK_EVEN;
case BreakBefore.COLUMN:
// if ColumnArea is empty return OK