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

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


  /**
   * Sets the default East Asia spelling language on ctStyles DocDefaults parameter
   * @param strEastAsia
   */
  public void setEastAsia(String strEastAsia) {
    CTDocDefaults docDefaults = null;
    CTRPr runProps = null;
    CTLanguage lang = null;

    // Just making sure we use the members that have already been defined
    if(ctStyles.isSetDocDefaults()) {
      docDefaults = ctStyles.getDocDefaults();
      if(docDefaults.isSetRPrDefault()) {
        CTRPrDefault RPrDefault = docDefaults.getRPrDefault();
        if(RPrDefault.isSetRPr()) {
          runProps = RPrDefault.getRPr();
          if(runProps.isSetLang())
            lang = runProps.getLang();
        }
      }
    }

    if(docDefaults == null)
      docDefaults = ctStyles.addNewDocDefaults();
    if(runProps == null)
      runProps = docDefaults.addNewRPrDefault().addNewRPr();
    if(lang == null)
      lang = runProps.addNewLang();

    lang.setEastAsia(strEastAsia);
  }
View Full Code Here


  /**
   * Sets the default font on ctStyles DocDefaults parameter
   * @param fonts
   */
  public void setDefaultFonts(CTFonts fonts) {
    CTDocDefaults docDefaults = null;
    CTRPr runProps = null;

    // Just making sure we use the members that have already been defined
    if(ctStyles.isSetDocDefaults()) {
      docDefaults = ctStyles.getDocDefaults();
      if(docDefaults.isSetRPrDefault()) {
        CTRPrDefault RPrDefault = docDefaults.getRPrDefault();
        if(RPrDefault.isSetRPr()) {
          runProps = RPrDefault.getRPr();
        }
      }
    }

    if(docDefaults == null)
      docDefaults = ctStyles.addNewDocDefaults();
    if(runProps == null)
      runProps = docDefaults.addNewRPrDefault().addNewRPr();

    runProps.setRFonts(fonts);
  }
View Full Code Here

  /**
   * Sets the default spelling language on ctStyles DocDefaults parameter
   * @param strSpellingLanguage
   */
  public void setSpellingLanguage(String strSpellingLanguage) {
    CTDocDefaults docDefaults = null;
    CTRPr runProps = null;
    CTLanguage lang = null;

    // Just making sure we use the members that have already been defined
    if(ctStyles.isSetDocDefaults()) {
      docDefaults = ctStyles.getDocDefaults();
      if(docDefaults.isSetRPrDefault()) {
        CTRPrDefault RPrDefault = docDefaults.getRPrDefault();
        if(RPrDefault.isSetRPr()) {
          runProps = RPrDefault.getRPr();
          if(runProps.isSetLang())
            lang = runProps.getLang();
        }
      }
    }

    if(docDefaults == null)
      docDefaults = ctStyles.addNewDocDefaults();
    if(runProps == null)
      runProps = docDefaults.addNewRPrDefault().addNewRPr();
    if(lang == null)
      lang = runProps.addNewLang();

    lang.setVal(strSpellingLanguage);
    lang.setBidi(strSpellingLanguage);
View Full Code Here

  /**
   * Sets the default East Asia spelling language on ctStyles DocDefaults parameter
   * @param strEastAsia
   */
  public void setEastAsia(String strEastAsia) {
    CTDocDefaults docDefaults = null;
    CTRPr runProps = null;
    CTLanguage lang = null;

    // Just making sure we use the members that have already been defined
    if(ctStyles.isSetDocDefaults()) {
      docDefaults = ctStyles.getDocDefaults();
      if(docDefaults.isSetRPrDefault()) {
        CTRPrDefault RPrDefault = docDefaults.getRPrDefault();
        if(RPrDefault.isSetRPr()) {
          runProps = RPrDefault.getRPr();
          if(runProps.isSetLang())
            lang = runProps.getLang();
        }
      }
    }

    if(docDefaults == null)
      docDefaults = ctStyles.addNewDocDefaults();
    if(runProps == null)
      runProps = docDefaults.addNewRPrDefault().addNewRPr();
    if(lang == null)
      lang = runProps.addNewLang();

    lang.setEastAsia(strEastAsia);
  }
View Full Code Here

  /**
   * Sets the default font on ctStyles DocDefaults parameter
   * @param fonts
   */
  public void setDefaultFonts(CTFonts fonts) {
    CTDocDefaults docDefaults = null;
    CTRPr runProps = null;

    // Just making sure we use the members that have already been defined
    if(ctStyles.isSetDocDefaults()) {
      docDefaults = ctStyles.getDocDefaults();
      if(docDefaults.isSetRPrDefault()) {
        CTRPrDefault RPrDefault = docDefaults.getRPrDefault();
        if(RPrDefault.isSetRPr()) {
          runProps = RPrDefault.getRPr();
        }
      }
    }

    if(docDefaults == null)
      docDefaults = ctStyles.addNewDocDefaults();
    if(runProps == null)
      runProps = docDefaults.addNewRPrDefault().addNewRPr();

    runProps.setRFonts(fonts);
  }
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

          XmlObject o = c.getObject();
          if(o instanceof CTR) {
             runs.add(new XWPFRun((CTR)o, this));
          }
          if(o instanceof CTHyperlink) {
             CTHyperlink link = (CTHyperlink)o;
             for(CTR r : link.getRList()) {
                runs.add(new XWPFHyperlinkRun(link, r, this));
             }
          }
          if(o instanceof CTSdtRun) {
             CTSdtContentRun run = ((CTSdtRun)o).getSdtContent();
View Full Code Here

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

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

        CTInd ind = ppr.addNewInd();
        ind.setLeft(new BigInteger("10"));
        assertEquals(10, p.getIndentationLeft());

        p.setIndentationLeft(100);
        assertEquals(100, ind.getLeft().intValue());
    }
View Full Code Here

     * </p>
     *
     * @param indentation
     */
    public void setIndentationLeft(int indentation) {
        CTInd indent = getCTInd(true);
        BigInteger bi = new BigInteger("" + indentation);
        indent.setLeft(bi);
    }
View Full Code Here

     * </p>
     *
     * @return indentation or null if indentation is not set
     */
    public int getIndentationLeft() {
        CTInd indentation = getCTInd(false);
        return (indentation != null && indentation.isSetLeft()) ? indentation.getLeft().intValue()
                : -1;
    }
View Full Code Here

TOP

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

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.