Search in sources :

Example 1 with CTTblBorders

use of org.openxmlformats.schemas.wordprocessingml.x2006.main.CTTblBorders in project poi by apache.

the class XWPFTable method getInsideVBorderSize.

public int getInsideVBorderSize() {
    int size = -1;
    CTTblPr tblPr = getTrPr();
    if (tblPr.isSetTblBorders()) {
        CTTblBorders ctb = tblPr.getTblBorders();
        if (ctb.isSetInsideV()) {
            CTBorder border = ctb.getInsideV();
            size = border.getSz().intValue();
        }
    }
    return size;
}
Also used : CTTblBorders(org.openxmlformats.schemas.wordprocessingml.x2006.main.CTTblBorders) CTBorder(org.openxmlformats.schemas.wordprocessingml.x2006.main.CTBorder) CTTblPr(org.openxmlformats.schemas.wordprocessingml.x2006.main.CTTblPr)

Example 2 with CTTblBorders

use of org.openxmlformats.schemas.wordprocessingml.x2006.main.CTTblBorders in project poi by apache.

the class XWPFTable method getInsideVBorderSpace.

public int getInsideVBorderSpace() {
    int space = -1;
    CTTblPr tblPr = getTrPr();
    if (tblPr.isSetTblBorders()) {
        CTTblBorders ctb = tblPr.getTblBorders();
        if (ctb.isSetInsideV()) {
            CTBorder border = ctb.getInsideV();
            space = border.getSpace().intValue();
        }
    }
    return space;
}
Also used : CTTblBorders(org.openxmlformats.schemas.wordprocessingml.x2006.main.CTTblBorders) CTBorder(org.openxmlformats.schemas.wordprocessingml.x2006.main.CTBorder) CTTblPr(org.openxmlformats.schemas.wordprocessingml.x2006.main.CTTblPr)

Example 3 with CTTblBorders

use of org.openxmlformats.schemas.wordprocessingml.x2006.main.CTTblBorders in project poi by apache.

the class XWPFTable method createEmptyTable.

private void createEmptyTable(CTTbl table) {
    // MINIMUM ELEMENTS FOR A TABLE
    table.addNewTr().addNewTc().addNewP();
    CTTblPr tblpro = table.addNewTblPr();
    tblpro.addNewTblW().setW(new BigInteger("0"));
    tblpro.getTblW().setType(STTblWidth.AUTO);
    // layout
    // tblpro.addNewTblLayout().setType(STTblLayoutType.AUTOFIT);
    // borders
    CTTblBorders borders = tblpro.addNewTblBorders();
    borders.addNewBottom().setVal(STBorder.SINGLE);
    borders.addNewInsideH().setVal(STBorder.SINGLE);
    borders.addNewInsideV().setVal(STBorder.SINGLE);
    borders.addNewLeft().setVal(STBorder.SINGLE);
    borders.addNewRight().setVal(STBorder.SINGLE);
    borders.addNewTop().setVal(STBorder.SINGLE);
    /*
         * CTTblGrid tblgrid=table.addNewTblGrid();
         * tblgrid.addNewGridCol().setW(new BigInteger("2000"));
         */
    getRows();
}
Also used : CTTblBorders(org.openxmlformats.schemas.wordprocessingml.x2006.main.CTTblBorders) CTTblPr(org.openxmlformats.schemas.wordprocessingml.x2006.main.CTTblPr) BigInteger(java.math.BigInteger)

Example 4 with CTTblBorders

use of org.openxmlformats.schemas.wordprocessingml.x2006.main.CTTblBorders in project poi by apache.

the class XWPFTable method getInsideVBorderColor.

public String getInsideVBorderColor() {
    String color = null;
    CTTblPr tblPr = getTrPr();
    if (tblPr.isSetTblBorders()) {
        CTTblBorders ctb = tblPr.getTblBorders();
        if (ctb.isSetInsideV()) {
            CTBorder border = ctb.getInsideV();
            color = border.xgetColor().getStringValue();
        }
    }
    return color;
}
Also used : CTTblBorders(org.openxmlformats.schemas.wordprocessingml.x2006.main.CTTblBorders) CTBorder(org.openxmlformats.schemas.wordprocessingml.x2006.main.CTBorder) CTTblPr(org.openxmlformats.schemas.wordprocessingml.x2006.main.CTTblPr) CTString(org.openxmlformats.schemas.wordprocessingml.x2006.main.CTString)

Example 5 with CTTblBorders

use of org.openxmlformats.schemas.wordprocessingml.x2006.main.CTTblBorders in project poi by apache.

the class XWPFTable method getInsideHBorderSize.

public int getInsideHBorderSize() {
    int size = -1;
    CTTblPr tblPr = getTrPr();
    if (tblPr.isSetTblBorders()) {
        CTTblBorders ctb = tblPr.getTblBorders();
        if (ctb.isSetInsideH()) {
            CTBorder border = ctb.getInsideH();
            size = border.getSz().intValue();
        }
    }
    return size;
}
Also used : CTTblBorders(org.openxmlformats.schemas.wordprocessingml.x2006.main.CTTblBorders) CTBorder(org.openxmlformats.schemas.wordprocessingml.x2006.main.CTBorder) CTTblPr(org.openxmlformats.schemas.wordprocessingml.x2006.main.CTTblPr)

Aggregations

CTTblBorders (org.openxmlformats.schemas.wordprocessingml.x2006.main.CTTblBorders)12 CTTblPr (org.openxmlformats.schemas.wordprocessingml.x2006.main.CTTblPr)11 CTBorder (org.openxmlformats.schemas.wordprocessingml.x2006.main.CTBorder)10 CTString (org.openxmlformats.schemas.wordprocessingml.x2006.main.CTString)2 BigInteger (java.math.BigInteger)1 XWPFBorderType (org.apache.poi.xwpf.usermodel.XWPFTable.XWPFBorderType)1 CTTbl (org.openxmlformats.schemas.wordprocessingml.x2006.main.CTTbl)1 STBorder (org.openxmlformats.schemas.wordprocessingml.x2006.main.STBorder)1