* the reference paragraph after where the column break inserted.
* @param breakAttribute
* the attribute name (page or column)
*/
private void addPageOrColumnBreak(Paragraph refParagraph, String breakAttribute) {
TextPElement pEle = null;
try {
OdfContentDom contentDocument = getContentDom();
OdfOfficeAutomaticStyles styles = contentDocument.getAutomaticStyles();
OdfStyle style = styles.newStyle(OdfStyleFamily.Paragraph);
style.newStyleParagraphPropertiesElement().setFoBreakBeforeAttribute(breakAttribute);
if(refParagraph == null){
pEle = getContentRoot().newTextPElement();
} else {
OfficeTextElement contentRoot = getContentRoot();
pEle = contentRoot.newTextPElement();
OdfElement refEle = refParagraph.getOdfElement();
contentRoot.insertBefore(pEle, refEle.getNextSibling());
}
pEle.setStyleName(style.getStyleNameAttribute());
} catch (Exception e) {
Logger.getLogger(TextDocument.class.getName()).log(Level.SEVERE, null, e);
throw new RuntimeException(breakAttribute + "Break appends failed.", e);
}
}