Search in sources :

Example 6 with CTTblBorders

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

the class XWPFTable method getInsideHBorderSpace.

public int getInsideHBorderSpace() {
    int space = -1;
    CTTblPr tblPr = getTrPr();
    if (tblPr.isSetTblBorders()) {
        CTTblBorders ctb = tblPr.getTblBorders();
        if (ctb.isSetInsideH()) {
            CTBorder border = ctb.getInsideH();
            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 7 with CTTblBorders

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

the class XWPFTable method getInsideHBorderColor.

public String getInsideHBorderColor() {
    String color = null;
    CTTblPr tblPr = getTrPr();
    if (tblPr.isSetTblBorders()) {
        CTTblBorders ctb = tblPr.getTblBorders();
        if (ctb.isSetInsideH()) {
            CTBorder border = ctb.getInsideH();
            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 8 with CTTblBorders

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

the class XWPFTable method setInsideHBorder.

public void setInsideHBorder(XWPFBorderType type, int size, int space, String rgbColor) {
    CTTblPr tblPr = getTrPr();
    CTTblBorders ctb = tblPr.isSetTblBorders() ? tblPr.getTblBorders() : tblPr.addNewTblBorders();
    CTBorder b = ctb.isSetInsideH() ? ctb.getInsideH() : ctb.addNewInsideH();
    b.setVal(xwpfBorderTypeMap.get(type));
    b.setSz(BigInteger.valueOf(size));
    b.setSpace(BigInteger.valueOf(space));
    b.setColor(rgbColor);
}
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 9 with CTTblBorders

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

the class XWPFTable method getInsideVBorderType.

public XWPFBorderType getInsideVBorderType() {
    XWPFBorderType bt = null;
    CTTblPr tblPr = getTrPr();
    if (tblPr.isSetTblBorders()) {
        CTTblBorders ctb = tblPr.getTblBorders();
        if (ctb.isSetInsideV()) {
            CTBorder border = ctb.getInsideV();
            bt = stBorderTypeMap.get(border.getVal().intValue());
        }
    }
    return bt;
}
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 10 with CTTblBorders

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

the class XWPFTable method setInsideVBorder.

public void setInsideVBorder(XWPFBorderType type, int size, int space, String rgbColor) {
    CTTblPr tblPr = getTrPr();
    CTTblBorders ctb = tblPr.isSetTblBorders() ? tblPr.getTblBorders() : tblPr.addNewTblBorders();
    CTBorder b = ctb.isSetInsideV() ? ctb.getInsideV() : ctb.addNewInsideV();
    b.setVal(xwpfBorderTypeMap.get(type));
    b.setSz(BigInteger.valueOf(size));
    b.setSpace(BigInteger.valueOf(space));
    b.setColor(rgbColor);
}
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