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

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


     * @param border
     * @see Borders for a list of all possible borders
     */
    public void setBorderBetween(Borders border) {
        CTPBdr ct = getCTPBrd(true);
        CTBorder pr = ct.isSetBetween() ? ct.getBetween() : ct.addNewBetween();
        if (border.getValue() == Borders.NONE.getValue())
            ct.unsetBetween();
        else
            pr.setVal(STBorder.Enum.forInt(border.getValue()));
    }
View Full Code Here


     * @see #setBorderBetween(Borders)
     * @see Borders for a list of all possible borders
     */
    public Borders getBorderBetween() {
        CTPBdr border = getCTPBrd(false);
        CTBorder ct = null;
        if (border != null) {
            ct = border.getBetween();
        }
        STBorder.Enum ptrn = ct != null ? ct.getVal() : STBorder.NONE;
        return Borders.valueOf(ptrn.intValue());
    }
View Full Code Here

    public void testAddPageBreak() {
  ctRun.addNewT().setStringValue("TEST STRING");
  ctRun.addNewBr();
  ctRun.addNewT().setStringValue("TEST2 STRING");
  CTBr breac=ctRun.addNewBr();
  breac.setClear(STBrClear.LEFT);
  ctRun.addNewT().setStringValue("TEST3 STRING");
        assertEquals(2, ctRun.sizeOfBrArray());
       
        XWPFRun run = new XWPFRun(CTR.Factory.newInstance(), p);
        run.setText("TEXT1");
View Full Code Here

             c = r.newCursor();
             c.selectPath("child::*");
             while (c.toNextSelection()) {
                XmlObject o = c.getObject();
                if(o instanceof CTFtnEdnRef) {
                   CTFtnEdnRef ftn = (CTFtnEdnRef)o;
                   footnoteText.append("[").append(ftn.getId()).append(": ");
                   XWPFFootnote footnote =
                      ftn.getDomNode().getLocalName().equals("footnoteReference") ?
                            document.getFootnoteByID(ftn.getId().intValue()) :
                            document.getEndnoteByID(ftn.getId().intValue());
  
                   boolean first = true;
                   for (XWPFParagraph p : footnote.getParagraphs()) {
                      if (!first) {
                         footnoteText.append("\n");
View Full Code Here

    //  doesn't seem that .docx properly supports that
    //  feature of the file format yet
    this.doc = doc;
    for(int i=0; i<sectPr.sizeOfHeaderReferenceArray(); i++) {
      // Get the header
      CTHdrFtrRef ref = sectPr.getHeaderReferenceArray(i);
      PackagePart hdrPart = doc.getPartById(ref.getId());
      HdrDocument hdrDoc = HdrDocument.Factory.parse(hdrPart.getInputStream());
      CTHdrFtr hdrFtr = hdrDoc.getHdr();
      XWPFHeader hdr = new XWPFHeader(doc, hdrFtr);

      // Assign it
      Enum type = ref.getType();
      assignHeader(hdr, type);
    }
    for(int i=0; i<sectPr.sizeOfFooterReferenceArray(); i++) {
      // Get the footer
      CTHdrFtrRef ref = sectPr.getFooterReferenceArray(i);
      PackagePart ftrPart = doc.getPartById(ref.getId());
      XWPFFooter ftr = new XWPFFooter(doc,
          FtrDocument.Factory.parse(ftrPart.getInputStream()).getFtr());

      // Assign it
      Enum type = ref.getType();
      assignFooter(ftr, type);
    }
  }
View Full Code Here

    return ftr;
  }


  private void setFooterReference(Enum type, XWPFHeaderFooter wrapper) {
    CTHdrFtrRef ref = doc.getDocument().getBody().getSectPr().addNewFooterReference();
      ref.setType(type);
      ref.setId(wrapper.getPackageRelationship().getId());
  }
View Full Code Here

      ref.setId(wrapper.getPackageRelationship().getId());
  }


  private void setHeaderReference(Enum type, XWPFHeaderFooter wrapper) {
    CTHdrFtrRef ref = doc.getDocument().getBody().getSectPr().addNewHeaderReference();
      ref.setType(type);
      ref.setId(wrapper.getPackageRelationship().getId());
  }
View Full Code Here

    //  doesn't seem that .docx properly supports that
    //  feature of the file format yet
    this.doc = doc;
    for(int i=0; i<sectPr.sizeOfHeaderReferenceArray(); i++) {
      // Get the header
      CTHdrFtrRef ref = sectPr.getHeaderReferenceArray(i);
      PackagePart hdrPart = doc.getPartById(ref.getId());
      HdrDocument hdrDoc = HdrDocument.Factory.parse(hdrPart.getInputStream());
      CTHdrFtr hdrFtr = hdrDoc.getHdr();
      XWPFHeader hdr = new XWPFHeader(hdrFtr);

      // Assign it
      Enum type = ref.getType();
      assignHeader(hdr, type);
    }
    for(int i=0; i<sectPr.sizeOfFooterReferenceArray(); i++) {
      // Get the footer
      CTHdrFtrRef ref = sectPr.getFooterReferenceArray(i);
      PackagePart ftrPart = doc.getPartById(ref.getId());
      XWPFFooter ftr = new XWPFFooter(
          FtrDocument.Factory.parse(ftrPart.getInputStream()).getFtr()
      );

      // Assign it
      Enum type = ref.getType();
      assignFooter(ftr, type);
    }
  }
View Full Code Here

    return ftr;
  }


  private void setFooterReference(Enum type, XWPFHeaderFooter wrapper) {
    CTHdrFtrRef ref = doc.getDocument().getBody().getSectPr().addNewFooterReference();
      ref.setType(type);
      ref.setId(wrapper.getPackageRelationship().getId());
  }
View Full Code Here

      ref.setId(wrapper.getPackageRelationship().getId());
  }


  private void setHeaderReference(Enum type, XWPFHeaderFooter wrapper) {
    CTHdrFtrRef ref = doc.getDocument().getBody().getSectPr().addNewHeaderReference();
      ref.setType(type);
      ref.setId(wrapper.getPackageRelationship().getId());
  }
View Full Code Here

TOP

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

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.