public void setRightBorderColor(CTColor color) { CTBorderPr pr = _border.isSetRight() ? _border.getRight() : _border.addNewRight(); if (color == null) { pr.unsetColor(); } else { pr.setColor(color); } }
/** * Set the color to use for the right border as a {@link XSSFColor} value * * @param color the color to use */ public void setRightBorderColor(XSSFColor color) { CTBorder ct = getCTBorder(); if(color == null && !ct.isSetRight()) return; CTBorderPr pr = ct.isSetRight() ? ct.getRight() : ct.addNewRight(); 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); }
@Override public void setBorderRight(BorderStyle border) { CTBorderPr pr = _border.isSetRight() ? _border.getRight() : _border.addNewRight(); if(border == BorderStyle.NONE) _border.unsetRight(); else pr.setStyle(STBorderStyle.Enum.forInt(border.getCode() + 1)); }
@Override public BorderStyle getBorderRight() { if(!_cellXf.getApplyBorder()) return BorderStyle.NONE; int idx = (int)_cellXf.getBorderId(); CTBorder ct = _stylesSource.getBorderAt(idx).getCTBorder(); STBorderStyle.Enum ptrn = ct.isSetRight() ? ct.getRight().getStyle() : null; if (ptrn == null) { return BorderStyle.NONE; } return BorderStyle.valueOf((short)(ptrn.intValue() - 1)); }
/** * Set the type of border to use for the right border of the cell * * @param border the type of border to use * @since POI 3.15 */ @Override public void setBorderRight(BorderStyle border) { CTBorder ct = getCTBorder(); CTBorderPr pr = ct.isSetRight() ? ct.getRight() : ct.addNewRight(); if(border == BorderStyle.NONE) ct.unsetRight(); 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); }
public short getRightBorderColor(){ if(!_border.isSetRight()) return 0; CTBorderPr pr = _border.getRight(); return (short)pr.getColor().getIndexed(); }
public short getBorderRight(){ STBorderStyle.Enum ptrn = _border.isSetRight() ? _border.getRight().getStyle() : null; return ptrn == null ? BORDER_NONE : (short)(ptrn.intValue() - 1); }
public void setRightBorderColor(CTColor color) { CTBorderPr pr = _border.isSetRight() ? _border.getRight() : _border.addNewRight(); if (color == null) { pr.unsetColor(); } else { pr.setColor(color); } }
public void setBorderRight(short border){ CTBorderPr pr = _border.isSetRight() ? _border.getRight() : _border.addNewRight(); if(border == BORDER_NONE) _border.unsetRight(); else pr.setStyle(STBorderStyle.Enum.forInt(border + 1)); }
public void setRightBorderColor(short color){ CTBorderPr pr = _border.isSetRight() ? _border.getRight() : _border.addNewRight(); CTColor ctColor = CTColor.Factory.newInstance(); ctColor.setIndexed(color); pr.setColor(ctColor); }
/** * Set the color to use for the right border as a {@link XSSFColor} value * * @param color the color to use */ public void setRightBorderColor(XSSFColor color) { CTBorder ct = getCTBorder(); if(color == null && !ct.isSetRight()) return; CTBorderPr pr = ct.isSetRight() ? ct.getRight() : ct.addNewRight(); if(color != null) pr.setColor(color.getCTColor()); else pr.unsetColor(); int idx = _stylesSource.putBorder(new XSSFCellBorder(ct, _theme)); _cellXf.setBorderId(idx); _cellXf.setApplyBorder(true); }
/** * Set the color to use for the right border as a {@link XSSFColor} value * * @param color the color to use */ public void setRightBorderColor(XSSFColor color) { CTBorder ct = getCTBorder(); if(color == null && !ct.isSetRight()) return; CTBorderPr pr = ct.isSetRight() ? ct.getRight() : ct.addNewRight(); 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); }
@Override public void setBorderRight(BorderStyle border) { CTBorderPr pr = _border.isSetRight() ? _border.getRight() : _border.addNewRight(); if(border == BorderStyle.NONE) _border.unsetRight(); else pr.setStyle(STBorderStyle.Enum.forInt(border.getCode() + 1)); }
@Override public BorderStyle getBorderRight() { if(!_cellXf.getApplyBorder()) return BorderStyle.NONE; int idx = (int)_cellXf.getBorderId(); CTBorder ct = _stylesSource.getBorderAt(idx).getCTBorder(); STBorderStyle.Enum ptrn = ct.isSetRight() ? ct.getRight().getStyle() : null; if (ptrn == null) { return BorderStyle.NONE; } return BorderStyle.valueOf((short)(ptrn.intValue() - 1)); }
/** * Get the type of border to use for the right border of the cell * * @return short - border type, default value is {@link org.apache.poi.ss.usermodel.CellStyle#BORDER_NONE} * @see org.apache.poi.ss.usermodel.CellStyle#BORDER_NONE * @see org.apache.poi.ss.usermodel.CellStyle#BORDER_THIN * @see org.apache.poi.ss.usermodel.CellStyle#BORDER_MEDIUM * @see org.apache.poi.ss.usermodel.CellStyle#BORDER_DASHED * @see org.apache.poi.ss.usermodel.CellStyle#BORDER_DOTTED * @see org.apache.poi.ss.usermodel.CellStyle#BORDER_THICK * @see org.apache.poi.ss.usermodel.CellStyle#BORDER_DOUBLE * @see org.apache.poi.ss.usermodel.CellStyle#BORDER_HAIR * @see org.apache.poi.ss.usermodel.CellStyle#BORDER_MEDIUM_DASHED * @see org.apache.poi.ss.usermodel.CellStyle#BORDER_DASH_DOT * @see org.apache.poi.ss.usermodel.CellStyle#BORDER_MEDIUM_DASH_DOT * @see org.apache.poi.ss.usermodel.CellStyle#BORDER_DASH_DOT_DOT * @see org.apache.poi.ss.usermodel.CellStyle#BORDER_MEDIUM_DASH_DOT_DOT * @see org.apache.poi.ss.usermodel.CellStyle#BORDER_SLANTED_DASH_DOT */ public short getBorderRight() { if(!_cellXf.getApplyBorder()) return BORDER_NONE; int idx = (int)_cellXf.getBorderId(); CTBorder ct = _stylesSource.getBorderAt(idx).getCTBorder(); STBorderStyle.Enum ptrn = ct.isSetRight() ? ct.getRight().getStyle() : null; return ptrn == null ? BORDER_NONE : (short)(ptrn.intValue() - 1); }
/** * Set the type of border to use for the right border of the cell * * @param border the type of border to use * @since POI 3.15 */ @Override public void setBorderRight(BorderStyle border) { CTBorder ct = getCTBorder(); CTBorderPr pr = ct.isSetRight() ? ct.getRight() : ct.addNewRight(); if(border == BorderStyle.NONE) ct.unsetRight(); 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); }
/** * Set the type of border to use for the right border of the cell * * @param border the type of border to use * @see org.apache.poi.ss.usermodel.CellStyle#BORDER_NONE * @see org.apache.poi.ss.usermodel.CellStyle#BORDER_THIN * @see org.apache.poi.ss.usermodel.CellStyle#BORDER_MEDIUM * @see org.apache.poi.ss.usermodel.CellStyle#BORDER_DASHED * @see org.apache.poi.ss.usermodel.CellStyle#BORDER_DOTTED * @see org.apache.poi.ss.usermodel.CellStyle#BORDER_THICK * @see org.apache.poi.ss.usermodel.CellStyle#BORDER_DOUBLE * @see org.apache.poi.ss.usermodel.CellStyle#BORDER_HAIR * @see org.apache.poi.ss.usermodel.CellStyle#BORDER_MEDIUM_DASHED * @see org.apache.poi.ss.usermodel.CellStyle#BORDER_DASH_DOT * @see org.apache.poi.ss.usermodel.CellStyle#BORDER_MEDIUM_DASH_DOT * @see org.apache.poi.ss.usermodel.CellStyle#BORDER_DASH_DOT_DOT * @see org.apache.poi.ss.usermodel.CellStyle#BORDER_MEDIUM_DASH_DOT_DOT * @see org.apache.poi.ss.usermodel.CellStyle#BORDER_SLANTED_DASH_DOT */ public void setBorderRight(short border) { CTBorder ct = getCTBorder(); CTBorderPr pr = ct.isSetRight() ? ct.getRight() : ct.addNewRight(); if(border == BORDER_NONE) ct.unsetRight(); else pr.setStyle(STBorderStyle.Enum.forInt(border + 1)); int idx = _stylesSource.putBorder(new XSSFCellBorder(ct, _theme)); _cellXf.setBorderId(idx); _cellXf.setApplyBorder(true); }