Examples of CTTcPr


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

    /**
     * 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.CTTcPr

     * Get the vertical alignment of the cell.
     * @return the cell alignment enum value
     */
    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.CTTcPr

          // get the cells in this row
          List<XWPFTableCell> cells = row.getTableCells();
            // 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);
                if (rowCt == 0) {
                  // header row
                  ctshd.setFill("A7BFDE");
View Full Code Here

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

     * Set cell color. This sets some associated values; for finer control
     * you may want to access these elements individually.
     * @param rgbStr - the desired cell color, in the hex form "RRGGBB".
     */
    public void setColor(String rgbStr) {
        CTTcPr tcpr = ctTc.isSetTcPr() ? ctTc.getTcPr() : ctTc.addNewTcPr();
        CTShd ctshd = tcpr.isSetShd() ? tcpr.getShd() : tcpr.addNewShd();
        ctshd.setColor("auto");
        ctshd.setVal(STShd.CLEAR);
        ctshd.setFill(rgbStr);
    }
View Full Code Here

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

     * Get cell color. Note that this method only returns the "fill" value.
     * @return RGB string of cell color
     */
    public String getColor() {
  String color = null;
  CTTcPr tcpr = ctTc.getTcPr();
  if (tcpr != null) {
      CTShd ctshd = tcpr.getShd();
      if (ctshd != null) {
    color = ctshd.xgetFill().getStringValue();
      }
  }
  return color;
View Full Code Here

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

    /**
     * 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.CTTcPr

     * Get the vertical alignment of the cell.
     * @return the cell alignment enum value
     */
    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.CTTcPr

          // get the cells in this row
          List<XWPFTableCell> cells = row.getTableCells();
            // 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);
                if (rowCt == 0) {
                  // header row
                  ctshd.setFill("A7BFDE");
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.