* @return an instance of the section
* @throws RuntimeException
* if content DOM could not be initialized
*/
public Section appendSection(String name) {
TextSectionElement newSectionEle = null;
try {
Document doc = (Document) ((OdfFileDom) headerEle
.getOwnerDocument()).getDocument();
OdfContentDom contentDocument = doc.getContentDom();
OdfOfficeAutomaticStyles styles = contentDocument
.getAutomaticStyles();
OdfStyle style = styles.newStyle(OdfStyleFamily.Section);
StyleSectionPropertiesElement sProperties = style
.newStyleSectionPropertiesElement();
sProperties.setTextDontBalanceTextColumnsAttribute(false);
sProperties.setStyleEditableAttribute(false);
StyleColumnsElement columnEle = sProperties
.newStyleColumnsElement(1);
columnEle.setFoColumnGapAttribute("0in");
newSectionEle = headerEle.newTextSectionElement("true", name);
newSectionEle.setStyleName(style.getStyleNameAttribute());
return Section.getInstance(newSectionEle);
} catch (Exception e) {
Logger.getLogger(TextDocument.class.getName()).log(Level.SEVERE,
null, e);