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

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


  throws IOException, XmlException {
    // first all paragraphs
    Iterator<XWPFParagraph> i = document.getParagraphsIterator();
    while (i.hasNext()) {
      XWPFParagraph paragraph = i.next();
      CTSectPr ctSectPr = null;
      if (paragraph.getCTP().getPPr() != null) {
        ctSectPr = paragraph.getCTP().getPPr().getSectPr();
      }

      XWPFHeaderFooterPolicy headerFooterPolicy = null;
View Full Code Here


        CTP ctp = p.getCTP();
        CTPPr ppr = ctp.getPPr()== null? ctp.addNewPPr() : ctp.getPPr();

        assertEquals(-1, p.getSpacingAfter());

        CTSpacing spacing = ppr.addNewSpacing();
        spacing.setAfter(new BigInteger("10"));
        assertEquals(10, p.getSpacingAfter());

        p.setSpacingAfter(100);
        assertEquals(100, spacing.getAfter().intValue());
    }
View Full Code Here

        CTP ctp = p.getCTP();
        CTPPr ppr = ctp.getPPr()== null? ctp.addNewPPr() : ctp.getPPr();

        assertEquals(STLineSpacingRule.INT_AUTO, p.getSpacingLineRule().getValue());

        CTSpacing spacing = ppr.addNewSpacing();
        spacing.setLineRule(STLineSpacingRule.AT_LEAST);
        assertEquals(LineSpacingRule.AT_LEAST, p.getSpacingLineRule());

        p.setSpacingAfter(100);
        assertEquals(100, spacing.getAfter().intValue());
    }
View Full Code Here

     * This is useful when, e.g. an Heading style has to be assigned
     * @param newStyle
     */
    public void setStyle(String newStyle) {
      CTPPr pr = getCTPPr();
      CTString style = pr.getPStyle() != null ? pr.getPStyle() : pr.addNewPStyle();
      style.setVal(newStyle);
    }
View Full Code Here

    /**
     * @return  the style of the paragraph
     */
    public String getStyle() {
      CTPPr pr = getCTPPr();
      CTString style = pr.isSetPStyle() ? pr.getPStyle() : null;
      return style != null ? style.getVal() : null;
    }
View Full Code Here

     * This is useful when, e.g. an Heading style has to be assigned
     * @param newStyle
     */
    public void setStyle(String newStyle) {
      CTPPr pr = getCTPPr();
      CTString style = pr.getPStyle() != null ? pr.getPStyle() : pr.addNewPStyle();
      style.setVal(newStyle);
    }
View Full Code Here

     * Gets the style of the paragraph
     * @return
     */
    public String getStyle() {
      CTPPr pr = getCTPPr();
      CTString style = pr.isSetPStyle() ? pr.getPStyle() : null;
      return style != null ? style.getVal() : null;
    }
View Full Code Here

     * This is useful when, e.g. an Heading style has to be assigned
     * @param newStyle
     */
    public void setStyle(String newStyle) {
      CTPPr pr = getCTPPr();
      CTString style = pr.getPStyle() != null ? pr.getPStyle() : pr.addNewPStyle();
      style.setVal(newStyle);
    }
View Full Code Here

    /**
     * @return  the style of the paragraph
     */
    public String getStyle() {
      CTPPr pr = getCTPPr();
      CTString style = pr.isSetPStyle() ? pr.getPStyle() : null;
      return style != null ? style.getVal() : null;
    }
View Full Code Here

     * This is useful when, e.g. an Heading style has to be assigned
     * @param newStyle
     */
    public void setStyle(String newStyle) {
        CTPPr pr = getCTPPr();
        CTString style = pr.getPStyle() != null ? pr.getPStyle() : pr.addNewPStyle();
        style.setVal(newStyle);
    }
View Full Code Here

TOP

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

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.