Search in sources :

Example 11 with CTFill

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

the class TestXSSFCellFill method testGetFillForegroundColor.

@Test
public void testGetFillForegroundColor() {
    CTFill ctFill = CTFill.Factory.newInstance();
    XSSFCellFill cellFill = new XSSFCellFill(ctFill, null);
    CTPatternFill ctPatternFill = ctFill.addNewPatternFill();
    CTColor fgColor = ctPatternFill.addNewFgColor();
    assertNotNull(cellFill.getFillForegroundColor());
    fgColor.setIndexed(8);
    assertEquals(8, cellFill.getFillForegroundColor().getIndexed());
}
Also used : CTFill(org.openxmlformats.schemas.spreadsheetml.x2006.main.CTFill) CTPatternFill(org.openxmlformats.schemas.spreadsheetml.x2006.main.CTPatternFill) CTColor(org.openxmlformats.schemas.spreadsheetml.x2006.main.CTColor) Test(org.junit.Test)

Aggregations

CTFill (org.openxmlformats.schemas.spreadsheetml.x2006.main.CTFill)11 CTPatternFill (org.openxmlformats.schemas.spreadsheetml.x2006.main.CTPatternFill)7 Test (org.junit.Test)6 CTColor (org.openxmlformats.schemas.spreadsheetml.x2006.main.CTColor)2 POIXMLException (org.apache.poi.POIXMLException)1 XSSFCellFill (org.apache.poi.xssf.usermodel.extensions.XSSFCellFill)1 XmlException (org.apache.xmlbeans.XmlException)1 CTBorder (org.openxmlformats.schemas.spreadsheetml.x2006.main.CTBorder)1 CTFont (org.openxmlformats.schemas.spreadsheetml.x2006.main.CTFont)1