Examples of StyleHeaderFooterPropertiesElement


Examples of org.odftoolkit.odfdom.dom.element.style.StyleHeaderFooterPropertiesElement

  private HashMap<String, String> getHeaderStyleProps(OdfDocument odfDoc, StyleMasterPageElement masterPage) throws Exception {
    StylePageLayoutElement pageLayout = getMasterPageLayout(odfDoc, masterPage);
    // ToDo: Combine a GETTER for header Properties in one method
    StyleHeaderStyleElement headerStyle = OdfElement.findFirstChildNode(StyleHeaderStyleElement.class, pageLayout);
    Assert.assertNotNull(headerStyle);
    StyleHeaderFooterPropertiesElement headerStyleProps = OdfElement.findFirstChildNode(StyleHeaderFooterPropertiesElement.class, headerStyle);
    Assert.assertNotNull(headerStyleProps);
    // fill map with header attributes name/values
    HashMap<String, String> headerProps = new HashMap<String, String>();
    NamedNodeMap headerAttrs = headerStyleProps.getAttributes();
    for (int i = 0; i < headerAttrs.getLength(); i++) {
      headerProps.put(headerAttrs.item(i).getNamespaceURI() + headerAttrs.item(i).getLocalName(), headerAttrs.item(i).getNodeValue());
    }
    return headerProps;
  }
View Full Code Here

Examples of org.odftoolkit.odfdom.dom.element.style.StyleHeaderFooterPropertiesElement

  private HashMap<String, String> getFooterStyleProps(OdfDocument odfDoc, StyleMasterPageElement masterPage) throws Exception {
    StylePageLayoutElement pageLayout = getMasterPageLayout(odfDoc, masterPage);
    // ODFDOM ToDo: Combine a GETTER for footer Properties in one method
    StyleFooterStyleElement footerStyle = OdfElement.findFirstChildNode(StyleFooterStyleElement.class, pageLayout);
    Assert.assertNotNull(footerStyle);
    StyleHeaderFooterPropertiesElement footerStyleProps = OdfElement.findFirstChildNode(StyleHeaderFooterPropertiesElement.class, footerStyle);
    Assert.assertNotNull(footerStyleProps);

    // fill map with header attributes name/values
    HashMap<String, String> footerProps = new HashMap<String, String>();
    NamedNodeMap footerAttrs = footerStyleProps.getAttributes();
    for (int i = 0; i < footerAttrs.getLength(); i++) {
      footerProps.put(footerAttrs.item(i).getNamespaceURI() + footerAttrs.item(i).getLocalName(), footerAttrs.item(i).getNodeValue());
    }
    return footerProps;
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.