本文整理了Java中org.apache.poi.ss.usermodel.CellStyle.getBorderLeftEnum()
方法的一些代码示例,展示了CellStyle.getBorderLeftEnum()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。CellStyle.getBorderLeftEnum()
方法的具体详情如下:
包路径:org.apache.poi.ss.usermodel.CellStyle
类名称:CellStyle
方法名:getBorderLeftEnum
[英]get the type of border to use for the left border of the cell
[中]
代码示例来源:origin: looly/hutool
/**
* 合并单元格,可以根据设置的值来合并行和列
*
* @param sheet 表对象
* @param firstRow 起始行,0开始
* @param lastRow 结束行,0开始
* @param firstColumn 起始列,0开始
* @param lastColumn 结束列,0开始
* @param cellStyle 单元格样式,只提取边框样式
* @return 合并后的单元格号
*/
public static int mergingCells(Sheet sheet, int firstRow, int lastRow, int firstColumn, int lastColumn, CellStyle cellStyle) {
final CellRangeAddress cellRangeAddress = new CellRangeAddress(//
firstRow, // first row (0-based)
lastRow, // last row (0-based)
firstColumn, // first column (0-based)
lastColumn // last column (0-based)
);
if (null != cellStyle) {
RegionUtil.setBorderTop(cellStyle.getBorderTopEnum(), cellRangeAddress, sheet);
RegionUtil.setBorderRight(cellStyle.getBorderRightEnum(), cellRangeAddress, sheet);
RegionUtil.setBorderBottom(cellStyle.getBorderBottomEnum(), cellRangeAddress, sheet);
RegionUtil.setBorderLeft(cellStyle.getBorderLeftEnum(), cellRangeAddress, sheet);
}
return sheet.addMergedRegion(cellRangeAddress);
}
代码示例来源:origin: looly/hutool
/**
* 合并单元格,可以根据设置的值来合并行和列
*
* @param sheet 表对象
* @param firstRow 起始行,0开始
* @param lastRow 结束行,0开始
* @param firstColumn 起始列,0开始
* @param lastColumn 结束列,0开始
* @param cellStyle 单元格样式,只提取边框样式
* @return 合并后的单元格号
*/
public static int mergingCells(Sheet sheet, int firstRow, int lastRow, int firstColumn, int lastColumn, CellStyle cellStyle) {
final CellRangeAddress cellRangeAddress = new CellRangeAddress(//
firstRow, // first row (0-based)
lastRow, // last row (0-based)
firstColumn, // first column (0-based)
lastColumn // last column (0-based)
);
if (null != cellStyle) {
RegionUtil.setBorderTop(cellStyle.getBorderTopEnum(), cellRangeAddress, sheet);
RegionUtil.setBorderRight(cellStyle.getBorderRightEnum(), cellRangeAddress, sheet);
RegionUtil.setBorderBottom(cellStyle.getBorderBottomEnum(), cellRangeAddress, sheet);
RegionUtil.setBorderLeft(cellStyle.getBorderLeftEnum(), cellRangeAddress, sheet);
}
return sheet.addMergedRegion(cellRangeAddress);
}
代码示例来源:origin: zerouwar/Octopus
public static void setMergeRegion(Sheet sheet, int row, int lastRow, int col, int lastCol, CellStyle cellStyle) {
int i = sheet.addMergedRegion(new CellRangeAddress(row, lastRow, col, lastCol));
/**
* seems like a bug
*/
CellRangeAddress region = sheet.getMergedRegion(sheet instanceof XSSFSheet ? i - 1 : i);
RegionUtil.setBorderTop(cellStyle.getBorderTopEnum(), region, sheet);
RegionUtil.setBorderLeft(cellStyle.getBorderLeftEnum(), region, sheet);
RegionUtil.setBorderBottom(cellStyle.getBorderBottomEnum(), region, sheet);
RegionUtil.setBorderRight(cellStyle.getBorderRightEnum(), region, sheet);
}
代码示例来源:origin: cn.hutool/hutool-all
/**
* 合并单元格,可以根据设置的值来合并行和列
*
* @param sheet 表对象
* @param firstRow 起始行,0开始
* @param lastRow 结束行,0开始
* @param firstColumn 起始列,0开始
* @param lastColumn 结束列,0开始
* @param cellStyle 单元格样式,只提取边框样式
* @return 合并后的单元格号
*/
public static int mergingCells(Sheet sheet, int firstRow, int lastRow, int firstColumn, int lastColumn, CellStyle cellStyle) {
final CellRangeAddress cellRangeAddress = new CellRangeAddress(//
firstRow, // first row (0-based)
lastRow, // last row (0-based)
firstColumn, // first column (0-based)
lastColumn // last column (0-based)
);
if (null != cellStyle) {
RegionUtil.setBorderTop(cellStyle.getBorderTopEnum(), cellRangeAddress, sheet);
RegionUtil.setBorderRight(cellStyle.getBorderRightEnum(), cellRangeAddress, sheet);
RegionUtil.setBorderBottom(cellStyle.getBorderBottomEnum(), cellRangeAddress, sheet);
RegionUtil.setBorderLeft(cellStyle.getBorderLeftEnum(), cellRangeAddress, sheet);
}
return sheet.addMergedRegion(cellRangeAddress);
}
代码示例来源:origin: pentaho/pentaho-reporting
protected HSSFCellStyleKey( final CellStyle style ) {
this.color = style.getFillForegroundColor();
this.colorTop = style.getTopBorderColor();
this.colorLeft = style.getLeftBorderColor();
this.colorBottom = style.getBottomBorderColor();
this.colorRight = style.getRightBorderColor();
this.borderStrokeTop = style.getBorderTopEnum();
this.borderStrokeLeft = style.getBorderLeftEnum();
this.borderStrokeBottom = style.getBorderBottomEnum();
this.borderStrokeRight = style.getBorderRightEnum();
this.dataStyle = style.getDataFormat();
this.font = style.getFontIndex();
this.horizontalAlignment = style.getAlignmentEnum();
this.verticalAlignment = style.getVerticalAlignmentEnum();
this.wrapText = style.getWrapText();
this.textRotation = TextRotation.getInstance( style.getRotation() );
}
内容来源于网络,如有侵权,请联系作者删除!