Examples of CTVerticalJc


Examples of org.docx4j.wml.CTVerticalJc

 
  /**
   * @since 3.0.0
   */ 
  public TextAlignmentVertical() { //Default-Alignment Top
  CTVerticalJc textAlignment = Context.getWmlObjectFactory().createCTVerticalJc();
    textAlignment.setVal(STVerticalJc.TOP);
    this.setObject(textAlignment);
  }
View Full Code Here

Examples of org.docx4j.wml.CTVerticalJc

 
  public TextAlignmentVertical(CSSValue value) { 
   
    debug(CSS_NAME, value);
   
    CTVerticalJc textAlignment = Context.getWmlObjectFactory().createCTVerticalJc();
   
    if (value.getCssText().toLowerCase().equals("top")) {
      textAlignment.setVal(STVerticalJc.TOP);
    } else if (value.getCssText().toLowerCase().equals("middle")) {
      textAlignment.setVal(STVerticalJc.CENTER);
    } else if (value.getCssText().toLowerCase().equals("bottom")) {
      textAlignment.setVal(STVerticalJc.BOTTOM);
    } else {
      log.warn("How to handle vertical-align: " + value.getCssText()); // eg baseline
      // Default to top or center..
      textAlignment.setVal(STVerticalJc.CENTER);     
    }   

    this.setObject( textAlignment  );
  }
View Full Code Here

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

     * Set the vertical alignment of the cell.
     * @param vAlign - the desired alignment enum value
     */
    public void setVerticalAlignment(XWPFVertAlign vAlign) {
        CTTcPr tcpr = ctTc.isSetTcPr() ? ctTc.getTcPr() : ctTc.addNewTcPr();
      CTVerticalJc va = tcpr.addNewVAlign();
      va.setVal(alignMap.get(vAlign));
    }
View Full Code Here

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

     */
    public XWPFVertAlign getVerticalAlignment() {
  XWPFVertAlign vAlign = null;
  CTTcPr tcpr = ctTc.getTcPr();
  if (ctTc != null) {
      CTVerticalJc va = tcpr.getVAlign();
      vAlign = stVertAlignTypeMap.get(va.getVal().intValue());
  }
  return vAlign;
    }
View Full Code Here

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

      // instantiate the following classes so they'll get picked up by
      // the XmlBean process and added to the jar file. they are required
      // for the following XWPFTableCell methods.
    CTShd ctShd = CTShd.Factory.newInstance();
    assertNotNull(ctShd);
    CTVerticalJc ctVjc = CTVerticalJc.Factory.newInstance();
    assertNotNull(ctVjc);
    STShd stShd = STShd.Factory.newInstance();
    assertNotNull(stShd);
    STVerticalJc stVjc = STVerticalJc.Factory.newInstance();
    assertNotNull(stVjc);
View Full Code Here

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

     * Set the vertical alignment of the cell.
     * @param vAlign - the desired alignment enum value
     */
    public void setVerticalAlignment(XWPFVertAlign vAlign) {
        CTTcPr tcpr = ctTc.isSetTcPr() ? ctTc.getTcPr() : ctTc.addNewTcPr();
      CTVerticalJc va = tcpr.addNewVAlign();
      va.setVal(alignMap.get(vAlign));
    }
View Full Code Here

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

     */
    public XWPFVertAlign getVerticalAlignment() {
  XWPFVertAlign vAlign = null;
  CTTcPr tcpr = ctTc.getTcPr();
  if (ctTc != null) {
      CTVerticalJc va = tcpr.getVAlign();
      vAlign = stVertAlignTypeMap.get(va.getVal().intValue());
  }
  return vAlign;
    }
View Full Code Here

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

     * Set the vertical alignment of the cell.
     * @param vAlign - the desired alignment enum value
     */
    public void setVerticalAlignment(XWPFVertAlign vAlign) {
        CTTcPr tcpr = ctTc.isSetTcPr() ? ctTc.getTcPr() : ctTc.addNewTcPr();
      CTVerticalJc va = tcpr.addNewVAlign();
      va.setVal(alignMap.get(vAlign));
    }
View Full Code Here

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

     */
    public XWPFVertAlign getVerticalAlignment() {
      XWPFVertAlign vAlign = null;
        CTTcPr tcpr = ctTc.getTcPr();
        if (ctTc != null) {
          CTVerticalJc va = tcpr.getVAlign();
          vAlign = stVertAlignTypeMap.get(va.getVal().intValue());
        }
        return vAlign;
    }
View Full Code Here

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

            // add content to each cell
          for (XWPFTableCell cell : cells) {
            // get a table cell properties element (tcPr)
            CTTcPr tcpr = cell.getCTTc().addNewTcPr();
            // set vertical alignment to "center"
            CTVerticalJc va = tcpr.addNewVAlign();
            va.setVal(STVerticalJc.CENTER);

            // create cell color element
            CTShd ctshd = tcpr.addNewShd();
                ctshd.setColor("auto");
                ctshd.setVal(STShd.CLEAR);
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.