Package org.openxmlformats.schemas.wordprocessingml.x2006.main

Examples of org.openxmlformats.schemas.wordprocessingml.x2006.main.CTHdrFtr


      setHeaderReference(type, wrapper);
    return hdr;
  }

  private CTHdrFtr buildHdrFtr(String pStyle, XWPFParagraph[] paragraphs) {
    CTHdrFtr ftr = CTHdrFtr.Factory.newInstance();
    if (paragraphs != null) {
      for (int i = 0 ; i < paragraphs.length ; i++) {
        CTP p = ftr.addNewP();
        //ftr.setPArray(0, paragraphs[i].getCTP());    // MB 23 May 2010
        ftr.setPArray(i, paragraphs[i].getCTP());     // MB 23 May 2010
      }
    }
    else {
      CTP p = ftr.addNewP();
      byte[] rsidr = doc.getDocument().getBody().getPArray(0).getRsidR();
      byte[] rsidrdefault = doc.getDocument().getBody().getPArray(0).getRsidRDefault();
      p.setRsidP(rsidr);
      p.setRsidRDefault(rsidrdefault);
      CTPPr pPr = p.addNewPPr();
View Full Code Here


   * it should have recovered the CTHdrFtr object encapsulated within the XWPFHeaderFooter object
   * that had previoulsy been instantiated in the createHeader(int, XWPFParagraph[]) or
   * createFooter(int, XWPFParagraph[]) methods.
   */
  private CTHdrFtr buildHdrFtr(String pStyle, XWPFParagraph[] paragraphs, XWPFHeaderFooter wrapper) {
    CTHdrFtr ftr = wrapper._getHdrFtr();
    if (paragraphs != null) {
      for (int i = 0 ; i < paragraphs.length ; i++) {
        CTP p = ftr.addNewP();
        ftr.setPArray(i, paragraphs[i].getCTP());
      }
    }
    else {
      CTP p = ftr.addNewP();
      byte[] rsidr = doc.getDocument().getBody().getPArray(0).getRsidR();
      byte[] rsidrdefault = doc.getDocument().getBody().getPArray(0).getRsidRDefault();
      p.setRsidP(rsidr);
      p.setRsidRDefault(rsidrdefault);
      CTPPr pPr = p.addNewPPr();
View Full Code Here

      String pStyle = "Header";
      int i = getRelationIndex(relation);
      HdrDocument hdrDoc = HdrDocument.Factory.newInstance();
      XWPFHeader wrapper = (XWPFHeader)doc.createRelationship(relation, XWPFFactory.getInstance(), i);

      CTHdrFtr hdr = buildHdr(type, pStyle, wrapper, pars);
      wrapper.setHeaderFooter(hdr);
     
      OutputStream outputStream = wrapper.getPackagePart().getOutputStream();
      hdrDoc.setHdr(hdr);
     
View Full Code Here

      String pStyle = "Footer";
      int i = getRelationIndex(relation);
      FtrDocument ftrDoc = FtrDocument.Factory.newInstance();
      XWPFFooter wrapper = (XWPFFooter)doc.createRelationship(relation, XWPFFactory.getInstance(), i);

      CTHdrFtr ftr = buildFtr(type, pStyle, wrapper, pars);
      wrapper.setHeaderFooter(ftr);
     
      OutputStream outputStream = wrapper.getPackagePart().getOutputStream();
      ftrDoc.setFtr(ftr);
     
View Full Code Here

  }


  private CTHdrFtr buildFtr(Enum type, String pStyle, XWPFHeaderFooter wrapper, XWPFParagraph[] pars) {
    //CTHdrFtr ftr = buildHdrFtr(pStyle, pars);        // MB 24 May 2010
    CTHdrFtr ftr = buildHdrFtr(pStyle, pars, wrapper);    // MB 24 May 2010
      setFooterReference(type, wrapper);
    return ftr;
  }
View Full Code Here

  }


  private CTHdrFtr buildHdr(Enum type, String pStyle, XWPFHeaderFooter wrapper, XWPFParagraph[] pars) {
    //CTHdrFtr hdr = buildHdrFtr(pStyle, pars);        // MB 24 May 2010
    CTHdrFtr hdr = buildHdrFtr(pStyle, pars, wrapper);    // MB 24 May 2010
      setHeaderReference(type, wrapper);
    return hdr;
  }
View Full Code Here

      setHeaderReference(type, wrapper);
    return hdr;
  }

  private CTHdrFtr buildHdrFtr(String pStyle, XWPFParagraph[] paragraphs) {
    CTHdrFtr ftr = CTHdrFtr.Factory.newInstance();
    if (paragraphs != null) {
      for (int i = 0 ; i < paragraphs.length ; i++) {
        CTP p = ftr.addNewP();
        //ftr.setPArray(0, paragraphs[i].getCTP());    // MB 23 May 2010
        ftr.setPArray(i, paragraphs[i].getCTP());     // MB 23 May 2010
      }
    }
    else {
      CTP p = ftr.addNewP();
      byte[] rsidr = doc.getDocument().getBody().getPArray(0).getRsidR();
      byte[] rsidrdefault = doc.getDocument().getBody().getPArray(0).getRsidRDefault();
      p.setRsidP(rsidr);
      p.setRsidRDefault(rsidrdefault);
      CTPPr pPr = p.addNewPPr();
View Full Code Here

   * it should have recovered the CTHdrFtr object encapsulated within the XWPFHeaderFooter object
   * that had previoulsy been instantiated in the createHeader(int, XWPFParagraph[]) or
   * createFooter(int, XWPFParagraph[]) methods.
   */
  private CTHdrFtr buildHdrFtr(String pStyle, XWPFParagraph[] paragraphs, XWPFHeaderFooter wrapper) {
    CTHdrFtr ftr = wrapper._getHdrFtr();
    if (paragraphs != null) {
      for (int i = 0 ; i < paragraphs.length ; i++) {
        CTP p = ftr.addNewP();
        ftr.setPArray(i, paragraphs[i].getCTP());
      }
    }
    else {
      CTP p = ftr.addNewP();
      byte[] rsidr = doc.getDocument().getBody().getPArray(0).getRsidR();
      byte[] rsidrdefault = doc.getDocument().getBody().getPArray(0).getRsidRDefault();
      p.setRsidP(rsidr);
      p.setRsidRDefault(rsidrdefault);
      CTPPr pPr = p.addNewPPr();
View Full Code Here

        String pStyle = "Header";
        int i = getRelationIndex(relation);
        HdrDocument hdrDoc = HdrDocument.Factory.newInstance();
        XWPFHeader wrapper = (XWPFHeader)doc.createRelationship(relation, XWPFFactory.getInstance(), i);

        CTHdrFtr hdr = buildHdr(type, pStyle, wrapper, pars);
        wrapper.setHeaderFooter(hdr);

        OutputStream outputStream = wrapper.getPackagePart().getOutputStream();
        hdrDoc.setHdr(hdr);
View Full Code Here

        String pStyle = "Footer";
        int i = getRelationIndex(relation);
        FtrDocument ftrDoc = FtrDocument.Factory.newInstance();
        XWPFFooter wrapper = (XWPFFooter)doc.createRelationship(relation, XWPFFactory.getInstance(), i);

        CTHdrFtr ftr = buildFtr(type, pStyle, wrapper, pars);
        wrapper.setHeaderFooter(ftr);

        OutputStream outputStream = wrapper.getPackagePart().getOutputStream();
        ftrDoc.setFtr(ftr);
View Full Code Here

TOP

Related Classes of org.openxmlformats.schemas.wordprocessingml.x2006.main.CTHdrFtr

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.