Package org.odftoolkit.odfdom.dom.element.text

Examples of org.odftoolkit.odfdom.dom.element.text.TextListHeaderElement


   *            the header to be set.
   */
  public void setHeader(String header) {
    if (header != null) {
      String[] headerContents = header.split("\n");
      TextListHeaderElement listHeaderElement = null;
      Node firstNode = listElement.getFirstChild();
      if (firstNode instanceof TextListHeaderElement) {
        listHeaderElement = (TextListHeaderElement) firstNode;
        Node pElement = listHeaderElement.getFirstChild();
        while (pElement != null) {
          firstNode.removeChild(pElement);
          pElement = pElement.getNextSibling();
        }
      } else {
        listHeaderElement = ((OdfFileDom) listElement.getOwnerDocument())
            .newOdfElement(TextListHeaderElement.class);
        listElement.insertBefore(listHeaderElement, firstNode);
      }
      for (String headerContent : headerContents) {
        TextPElement pElement = listHeaderElement.newTextPElement();
        pElement.setTextContent(headerContent);
      }
    }
  }
View Full Code Here

TOP

Related Classes of org.odftoolkit.odfdom.dom.element.text.TextListHeaderElement

Copyright © 2018 www.massapicom. 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.