Search in sources :

Example 1 with CTStylesheet

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

the class TestXSSFBorder method testGetBorderStyle.

public void testGetBorderStyle() {
    CTStylesheet stylesheet = CTStylesheet.Factory.newInstance();
    CTBorder border = stylesheet.addNewBorders().addNewBorder();
    CTBorderPr top = border.addNewTop();
    CTBorderPr right = border.addNewRight();
    CTBorderPr bottom = border.addNewBottom();
    top.setStyle(STBorderStyle.DASH_DOT);
    right.setStyle(STBorderStyle.NONE);
    bottom.setStyle(STBorderStyle.THIN);
    XSSFCellBorder cellBorderStyle = new XSSFCellBorder(border);
    assertEquals("DASH_DOT", cellBorderStyle.getBorderStyle(BorderSide.TOP).toString());
    assertEquals("NONE", cellBorderStyle.getBorderStyle(BorderSide.RIGHT).toString());
    assertEquals(BorderStyle.NONE.ordinal(), cellBorderStyle.getBorderStyle(BorderSide.RIGHT).ordinal());
    assertEquals("THIN", cellBorderStyle.getBorderStyle(BorderSide.BOTTOM).toString());
    assertEquals(BorderStyle.THIN.ordinal(), cellBorderStyle.getBorderStyle(BorderSide.BOTTOM).ordinal());
}
Also used : CTBorder(org.openxmlformats.schemas.spreadsheetml.x2006.main.CTBorder) CTStylesheet(org.openxmlformats.schemas.spreadsheetml.x2006.main.CTStylesheet) CTBorderPr(org.openxmlformats.schemas.spreadsheetml.x2006.main.CTBorderPr)

Aggregations

CTBorder (org.openxmlformats.schemas.spreadsheetml.x2006.main.CTBorder)1 CTBorderPr (org.openxmlformats.schemas.spreadsheetml.x2006.main.CTBorderPr)1 CTStylesheet (org.openxmlformats.schemas.spreadsheetml.x2006.main.CTStylesheet)1