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

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


     * @param pos
     * @return  the inserted row
     */
    public XWPFTableRow insertNewTableRow(int pos){
      if(pos >= 0 && pos <= tableRows.size()){
        CTRow row = ctTbl.insertNewTr(pos);
        XWPFTableRow tableRow = new XWPFTableRow(row, this);
        tableRows.add(pos, tableRow);
        return tableRow;
      }
      return null;
View Full Code Here



    public void testGetText() {
        XWPFDocument doc = new XWPFDocument();
        CTTbl table = CTTbl.Factory.newInstance();
        CTRow row = table.addNewTr();
        CTTc cell = row.addNewTc();
        CTP paragraph = cell.addNewP();
        CTR run = paragraph.addNewR();
        CTText text = run.addNewT();
        text.setStringValue("finally I can write!");
View Full Code Here

    public void testCreateRow() {
        XWPFDocument doc = new XWPFDocument();

        CTTbl table = CTTbl.Factory.newInstance();
        CTRow r1 = table.addNewTr();
        r1.addNewTc().addNewP();
        r1.addNewTc().addNewP();
        CTRow r2 = table.addNewTr();
        r2.addNewTc().addNewP();
        r2.addNewTc().addNewP();
        CTRow r3 = table.addNewTr();
        r3.addNewTc().addNewP();
        r3.addNewTc().addNewP();

        XWPFTable xtab = new XWPFTable(table, doc);
        assertEquals(3, xtab.getNumberOfRows());
        assertNotNull(xtab.getRow(2));
View Full Code Here

  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

     * 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

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

  public void testSetGetVertAlignment() throws Exception {
      // 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);
View Full Code Here

     * 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

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

     * 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

TOP

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

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.