log.debug("starting flow: " + fl.getFlowName());
if (fl.getFlowName().equals("xsl-region-body")) {
// if there is no header in current page-sequence but there has been
// a header in a previous page-sequence, insert an empty header.
if (bPrevHeaderSpecified && !bHeaderSpecified) {
RtfAttributes attr = new RtfAttributes();
attr.set(RtfBefore.HEADER);
final IRtfBeforeContainer contBefore
= (IRtfBeforeContainer)builderContext.getContainer
(IRtfBeforeContainer.class, true, this);
contBefore.newBefore(attr);
}
// if there is no footer in current page-sequence but there has been
// 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);
}
} else if (fl.getFlowName().equals("xsl-region-before")) {
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);
} else if (fl.getFlowName().equals("xsl-region-after")) {
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);
}
} catch (IOException ioe) {