use of org.apache.poi.xssf.usermodel.extensions.XSSFCellBorder in project poi by apache.
the class XSSFCellStyle method getLeftBorderXSSFColor.
/**
* Get the color to use for the left border
*
* @return the index of the color definition or <code>null</code> if not set
* @see org.apache.poi.ss.usermodel.IndexedColors
*/
public XSSFColor getLeftBorderXSSFColor() {
if (!_cellXf.getApplyBorder())
return null;
int idx = (int) _cellXf.getBorderId();
XSSFCellBorder border = _stylesSource.getBorderAt(idx);
return border.getBorderColor(BorderSide.LEFT);
}
use of org.apache.poi.xssf.usermodel.extensions.XSSFCellBorder in project poi by apache.
the class XSSFCellStyle method setBottomBorderColor.
/**
* Set the color to use for the bottom border
*
* @param color the color to use, null means no color
*/
public void setBottomBorderColor(XSSFColor color) {
CTBorder ct = getCTBorder();
if (color == null && !ct.isSetBottom())
return;
CTBorderPr pr = ct.isSetBottom() ? ct.getBottom() : ct.addNewBottom();
if (color != null)
pr.setColor(color.getCTColor());
else
pr.unsetColor();
int idx = _stylesSource.putBorder(new XSSFCellBorder(ct, _theme, _stylesSource.getIndexedColors()));
_cellXf.setBorderId(idx);
_cellXf.setApplyBorder(true);
}
use of org.apache.poi.xssf.usermodel.extensions.XSSFCellBorder in project poi by apache.
the class XSSFCellStyle method setBorderLeft.
/**
* Set the type of border to use for the left border of the cell
*
* @param border the type of border to use
* @since POI 3.15
*/
@Override
public void setBorderLeft(BorderStyle border) {
CTBorder ct = getCTBorder();
CTBorderPr pr = ct.isSetLeft() ? ct.getLeft() : ct.addNewLeft();
if (border == BorderStyle.NONE)
ct.unsetLeft();
else
pr.setStyle(STBorderStyle.Enum.forInt(border.getCode() + 1));
int idx = _stylesSource.putBorder(new XSSFCellBorder(ct, _theme, _stylesSource.getIndexedColors()));
_cellXf.setBorderId(idx);
_cellXf.setApplyBorder(true);
}
Aggregations