// a footer in a previous page-sequence, insert an empty footer.
if (bPrevFooterSpecified && !bFooterSpecified) {
RtfAttributes attr = new RtfAttributes();
attr.set(RtfAfter.FOOTER);
final IRtfAfterContainer contAfter
= (IRtfAfterContainer)builderContext.getContainer
(IRtfAfterContainer.class, true, this);
contAfter.newAfter(attr);
}
handled = true;
} else if (regionBefore != null
&& fl.getFlowName().equals(regionBefore.getRegionName())) {
bHeaderSpecified = true;
bPrevHeaderSpecified = true;
final IRtfBeforeContainer c
= (IRtfBeforeContainer)builderContext.getContainer(
IRtfBeforeContainer.class,
true, this);
RtfAttributes beforeAttributes = ((RtfElement)c).getRtfAttributes();
if (beforeAttributes == null) {
beforeAttributes = new RtfAttributes();
}
beforeAttributes.set(RtfBefore.HEADER);
RtfBefore before = c.newBefore(beforeAttributes);
builderContext.pushContainer(before);
handled = true;
} else if (regionAfter != null
&& fl.getFlowName().equals(regionAfter.getRegionName())) {
bFooterSpecified = true;
bPrevFooterSpecified = true;
final IRtfAfterContainer c
= (IRtfAfterContainer)builderContext.getContainer(
IRtfAfterContainer.class,
true, this);
RtfAttributes afterAttributes = ((RtfElement)c).getRtfAttributes();
if (afterAttributes == null) {
afterAttributes = new RtfAttributes();
}
afterAttributes.set(RtfAfter.FOOTER);
RtfAfter after = c.newAfter(afterAttributes);
builderContext.pushContainer(after);
handled = true;
}
if (!handled) {
log.warn("A " + fl.getLocalName() + " has been skipped: " + fl.getFlowName());