Examples of CTShd


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

            // 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");
                }
              else if (rowCt % 2 == 0) {
                // even row
                  ctshd.setFill("D3DFEE");
              }
              else {
                // odd row
                  ctshd.setFill("EDF2F8");
              }

                // get 1st paragraph in cell's paragraph list
                XWPFParagraph para = cell.getParagraphs().get(0);
                // create a run to contain the content
View Full Code Here

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

     * 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.CTShd

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

            // 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");
                }
              else if (rowCt % 2 == 0) {
                // even row
                  ctshd.setFill("D3DFEE");
              }
              else {
                // odd row
                  ctshd.setFill("EDF2F8");
              }

                // get 1st paragraph in cell's paragraph list
                XWPFParagraph para = cell.getParagraphs().get(0);
                // create a run to contain the content
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.