Search in sources :

Example 1 with STBorderStyle

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

the class TestXSSFCellStyle method testGetSetBorderNone.

// Border Styles, in BorderStyle/STBorderStyle enum order
@Test
public void testGetSetBorderNone() {
    cellStyle.setBorderTop(BorderStyle.NONE);
    assertEquals(BorderStyle.NONE, cellStyle.getBorderTopEnum());
    int borderId = (int) cellStyle.getCoreXf().getBorderId();
    assertTrue(borderId > 0);
    //check changes in the underlying xml bean
    CTBorder ctBorder = stylesTable.getBorderAt(borderId).getCTBorder();
    assertNull(ctBorder.getTop());
// no border style and STBorderStyle.NONE are equivalent
// POI prefers to unset the border style than explicitly set it STBorderStyle.NONE
}
Also used : CTBorder(org.openxmlformats.schemas.spreadsheetml.x2006.main.CTBorder) Test(org.junit.Test)

Aggregations

Test (org.junit.Test)1 CTBorder (org.openxmlformats.schemas.spreadsheetml.x2006.main.CTBorder)1