Search in sources :

Example 1 with CTSheetPr

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

the class SXSSFSheet method setTabColor.

/**
     * Set background color of the sheet tab
     *
     * @param colorIndex  the indexed color to set, must be a constant from {@link IndexedColors}
     */
public void setTabColor(int colorIndex) {
    CTWorksheet ct = _sh.getCTWorksheet();
    CTSheetPr pr = ct.getSheetPr();
    if (pr == null)
        pr = ct.addNewSheetPr();
    CTColor color = CTColor.Factory.newInstance();
    color.setIndexed(colorIndex);
    pr.setTabColor(color);
}
Also used : CTWorksheet(org.openxmlformats.schemas.spreadsheetml.x2006.main.CTWorksheet) CTSheetPr(org.openxmlformats.schemas.spreadsheetml.x2006.main.CTSheetPr) CTColor(org.openxmlformats.schemas.spreadsheetml.x2006.main.CTColor)

Aggregations

CTColor (org.openxmlformats.schemas.spreadsheetml.x2006.main.CTColor)1 CTSheetPr (org.openxmlformats.schemas.spreadsheetml.x2006.main.CTSheetPr)1 CTWorksheet (org.openxmlformats.schemas.spreadsheetml.x2006.main.CTWorksheet)1