Search in sources :

Example 6 with CTBorder

use of org.openxmlformats.schemas.spreadsheetml.x2006.main.CTBorder 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 7 with CTBorder

use of org.openxmlformats.schemas.spreadsheetml.x2006.main.CTBorder 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)

Example 8 with CTBorder

use of org.openxmlformats.schemas.spreadsheetml.x2006.main.CTBorder 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 9 with CTBorder

use of org.openxmlformats.schemas.spreadsheetml.x2006.main.CTBorder 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 10 with CTBorder

use of org.openxmlformats.schemas.spreadsheetml.x2006.main.CTBorder in project poi by apache.

the class XSSFCellBorder method getBorderStyle.

/**
     * Get the type of border to use for the selected border
     *
     * @param side -  - where to apply the color definition
     * @return borderstyle - the type of border to use. default value is NONE if border style is not set.
     * @see BorderStyle
     */
public BorderStyle getBorderStyle(BorderSide side) {
    CTBorderPr ctBorder = getBorder(side);
    STBorderStyle.Enum border = ctBorder == null ? STBorderStyle.NONE : ctBorder.getStyle();
    return BorderStyle.values()[border.intValue() - 1];
}
Also used : CTBorderPr(org.openxmlformats.schemas.spreadsheetml.x2006.main.CTBorderPr) STBorderStyle(org.openxmlformats.schemas.spreadsheetml.x2006.main.STBorderStyle)

Aggregations

CTBorder (org.openxmlformats.schemas.spreadsheetml.x2006.main.CTBorder)25 CTBorder (org.openxmlformats.schemas.wordprocessingml.x2006.main.CTBorder)11 Test (org.junit.Test)10 CTBorderPr (org.openxmlformats.schemas.spreadsheetml.x2006.main.CTBorderPr)10 CTTblBorders (org.openxmlformats.schemas.wordprocessingml.x2006.main.CTTblBorders)10 CTTblPr (org.openxmlformats.schemas.wordprocessingml.x2006.main.CTTblPr)10 XSSFCellBorder (org.apache.poi.xssf.usermodel.extensions.XSSFCellBorder)9 STBorderStyle (org.openxmlformats.schemas.spreadsheetml.x2006.main.STBorderStyle)5 CTString (org.openxmlformats.schemas.wordprocessingml.x2006.main.CTString)2 POIXMLException (org.apache.poi.POIXMLException)1 XmlException (org.apache.xmlbeans.XmlException)1 CTFill (org.openxmlformats.schemas.spreadsheetml.x2006.main.CTFill)1 CTFont (org.openxmlformats.schemas.spreadsheetml.x2006.main.CTFont)1 CTStylesheet (org.openxmlformats.schemas.spreadsheetml.x2006.main.CTStylesheet)1 CTP (org.openxmlformats.schemas.wordprocessingml.x2006.main.CTP)1 CTPBdr (org.openxmlformats.schemas.wordprocessingml.x2006.main.CTPBdr)1 CTPPr (org.openxmlformats.schemas.wordprocessingml.x2006.main.CTPPr)1