Search in sources :

Example 36 with CTBorder

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

the class TestXSSFCellStyle method testGetSetBorderXMLBean.

private void testGetSetBorderXMLBean(BorderStyle border, STBorderStyle.Enum expected) {
    cellStyle.setBorderTop(border);
    assertEquals(border, cellStyle.getBorderTopEnum());
    int borderId = (int) cellStyle.getCoreXf().getBorderId();
    assertTrue(borderId > 0);
    //check changes in the underlying xml bean
    CTBorder ctBorder = stylesTable.getBorderAt(borderId).getCTBorder();
    assertEquals(expected, ctBorder.getTop().getStyle());
}
Also used : CTBorder(org.openxmlformats.schemas.spreadsheetml.x2006.main.CTBorder)

Aggregations

CTBorder (org.openxmlformats.schemas.spreadsheetml.x2006.main.CTBorder)25 CTBorder (org.openxmlformats.schemas.wordprocessingml.x2006.main.CTBorder)11 Test (org.junit.Test)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 CTBorderPr (org.openxmlformats.schemas.spreadsheetml.x2006.main.CTBorderPr)9 STBorderStyle (org.openxmlformats.schemas.spreadsheetml.x2006.main.STBorderStyle)4 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