*
* @return the header of this text document.
* @since 0.5
*/
public Header getHeader(boolean isFirstPage) {
Header tmpHeader = isFirstPage ? firstPageHeader : standardHeader;
if (tmpHeader == null) {
try {
StyleMasterPageElement masterPageElement = getMasterPage(isFirstPage);
StyleHeaderElement headerElement = OdfElement.findFirstChildNode(StyleHeaderElement.class,
masterPageElement);
if (headerElement == null) {
headerElement = masterPageElement.newStyleHeaderElement();
}
tmpHeader = new Header(headerElement);
} catch (Exception e) {
Logger.getLogger(TextDocument.class.getName()).log(Level.SEVERE, null, e);
}
if (isFirstPage) {
firstPageHeader = tmpHeader;