/** * Set the foreground fill color represented as a {@link XSSFColor} value. * * @param color - the color to use */ public void setFillForegroundColor(XSSFColor color) { CTPatternFill ptrn = ensureCTPatternFill(); if (color == null) { ptrn.unsetFgColor(); } else { ptrn.setFgColor(color.getCTColor()); } }
private void setFillForegroundColor(CTColor color) { CTPatternFill ptrn = _fill.isSetPatternFill() ? _fill.getPatternFill() : _fill.addNewPatternFill(); if (color == null) { ptrn.unsetFgColor(); } else { ptrn.setFgColor(color); } }
/** * Set the foreground fill color represented as a {@link XSSFColor} value. * <br> * <i>Note: Ensure Foreground color is set prior to background color.</i> * @param color the color to use * @see #setFillBackgroundColor(org.apache.poi.xssf.usermodel.XSSFColor) ) */ public void setFillForegroundColor(XSSFColor color) { CTFill ct = getCTFill(); CTPatternFill ptrn = ct.getPatternFill(); if(color == null) { if(ptrn != null && ptrn.isSetFgColor()) ptrn.unsetFgColor(); } else { if(ptrn == null) ptrn = ct.addNewPatternFill(); ptrn.setFgColor(color.getCTColor()); } addFill(ct); }
/** * Set the foreground fill color represented as a {@link XSSFColor} value. * * @param color - the color to use */ public void setFillForegroundColor(XSSFColor color) { CTPatternFill ptrn = ensureCTPatternFill(); ptrn.setFgColor(color.getCTColor()); }
/** * Set the foreground fill color represented as a {@link XSSFColor} value. * * @param color - the color to use */ public void setFillForegroundColor(XSSFColor color) { CTPatternFill ptrn = ensureCTPatternFill(); if (color == null) { ptrn.unsetFgColor(); } else { ptrn.setFgColor(color.getCTColor()); } }
private void setFillForegroundColor(CTColor color) { CTPatternFill ptrn = _fill.isSetPatternFill() ? _fill.getPatternFill() : _fill.addNewPatternFill(); if (color == null) { ptrn.unsetFgColor(); } else { ptrn.setFgColor(color); } }
public void setFillForegroundColor(short fg){ CTPatternFill ptrn = _fill.isSetPatternFill() ? _fill.getPatternFill() : _fill.addNewPatternFill(); CTColor fgColor = CTColor.Factory.newInstance(); fgColor.setIndexed(fg); ptrn.setFgColor(fgColor); }
/** * Set the foreground fill color represented as a {@link XSSFColor} value. * <br> * <i>Note: Ensure Foreground color is set prior to background color.</i> * @param color the color to use * @see #setFillBackgroundColor(org.apache.poi.xssf.usermodel.XSSFColor) ) */ public void setFillForegroundColor(XSSFColor color) { CTFill ct = getCTFill(); CTPatternFill ptrn = ct.getPatternFill(); if(color == null) { if(ptrn != null && ptrn.isSetFgColor()) ptrn.unsetFgColor(); } else { if(ptrn == null) ptrn = ct.addNewPatternFill(); ptrn.setFgColor(color.getCTColor()); } addFill(ct); }
/** * Set the foreground fill color represented as a {@link XSSFColor} value. * <br/> * <i>Note: Ensure Foreground color is set prior to background color.</i> * @param color the color to use * @see #setFillBackgroundColor(org.apache.poi.xssf.usermodel.XSSFColor) ) */ public void setFillForegroundColor(XSSFColor color) { CTFill ct = getCTFill(); CTPatternFill ptrn = ct.getPatternFill(); if(color == null) { if(ptrn != null) ptrn.unsetFgColor(); } else { if(ptrn == null) ptrn = ct.addNewPatternFill(); ptrn.setFgColor(color.getCTColor()); } int idx = _stylesSource.putFill(new XSSFCellFill(ct)); _cellXf.setFillId(idx); _cellXf.setApplyFill(true); }