类 StyleHelper
java.lang.Object
cn.toutatis.xvoid.axolotl.excel.writer.style.StyleHelper
Excel样式助手
- 作者:
- Toutatis_Gc
-
字段概要
字段修饰符和类型字段说明static final AxolotlColor黑色颜色static final short默认文本格式化索引预置单元格长度static final Integer身份证号长度static final String默认使用字体static final Short默认表头行高static final Short默认文本字体大小static final AxolotlColor默认主题颜色static final Short默认标题字体大小static final Short默认标题行高static final int默认起始位置static final AxolotlColor白色颜色 -
构造器概要
构造器 -
方法概要
修饰符和类型方法说明static org.apache.poi.ss.usermodel.CellStylecreateCellStyle(org.apache.poi.ss.usermodel.Workbook workbook, org.apache.poi.ss.usermodel.BorderStyle borderStyle, org.apache.poi.ss.usermodel.IndexedColors borderColor, AxolotlColor foregroundColor) 创建具有指定边框样式、边框颜色、前景色的单元格样式。static org.apache.poi.ss.usermodel.CellStylecreateCellStyle(org.apache.poi.ss.usermodel.Workbook workbook, org.apache.poi.ss.usermodel.BorderStyle borderStyle, org.apache.poi.ss.usermodel.IndexedColors borderColor, AxolotlColor foregroundColor, org.apache.poi.ss.usermodel.Font font) 创建通用的单元格样式static org.apache.poi.ss.usermodel.CellStylecreateStandardCellStyle(org.apache.poi.ss.usermodel.Workbook workbook, org.apache.poi.ss.usermodel.BorderStyle borderStyle, org.apache.poi.ss.usermodel.IndexedColors borderColor, AxolotlColor foregroundColor, org.apache.poi.ss.usermodel.Font font) 创建标准单元格样式static org.apache.poi.ss.usermodel.FontcreateWorkBookFont(org.apache.poi.ss.usermodel.Workbook workbook, String fontName, boolean bold, short fontSize, org.apache.poi.ss.usermodel.IndexedColors fontColor) 创建工作簿字体static IntegergetPresetCellLength(String cellName) 获取预置单元格长度static voidrenderMergeRegionStyle(org.apache.poi.ss.usermodel.Sheet sheet, org.apache.poi.ss.util.CellRangeAddress cellRangeAddress, org.apache.poi.ss.usermodel.CellStyle style) 渲染合并单元格样式static voidsetCellAsPlainText(org.apache.poi.ss.usermodel.CellStyle cellStyle) 设置单元格为纯文本static voidsetCellStyleAlignment(org.apache.poi.ss.usermodel.CellStyle cellStyle, org.apache.poi.ss.usermodel.HorizontalAlignment horizontalAlignment, org.apache.poi.ss.usermodel.VerticalAlignment verticalAlignment) 设置单元格对齐方式static voidsetCellStyleAlignmentCenter(org.apache.poi.ss.usermodel.CellStyle cellStyle) 设置单元格水平居中,垂直居中对齐
-
字段详细资料
-
PRESET_CELL_LENGTH_MAP
预置单元格长度 -
STANDARD_FONT_NAME
默认使用字体- 另请参阅:
-
WHITE_COLOR
白色颜色 -
BLACK_COLOR
黑色颜色 -
STANDARD_THEME_COLOR
默认主题颜色 -
START_POSITION
public static final int START_POSITION默认起始位置- 另请参阅:
-
STANDARD_TITLE_FONT_SIZE
默认标题字体大小 -
STANDARD_TITLE_ROW_HEIGHT
默认标题行高 -
STANDARD_HEADER_ROW_HEIGHT
默认表头行高 -
STANDARD_TEXT_FONT_SIZE
默认文本字体大小 -
SERIAL_NUMBER_LENGTH
身份证号长度 -
DATA_FORMAT_PLAIN_TEXT_INDEX
public static final short DATA_FORMAT_PLAIN_TEXT_INDEX默认文本格式化索引- 另请参阅:
-
-
构造器详细资料
-
StyleHelper
public StyleHelper()
-
-
方法详细资料
-
getPresetCellLength
获取预置单元格长度- 参数:
cellName- 单元格名称- 返回:
- 预置单元格长度
-
renderMergeRegionStyle
public static void renderMergeRegionStyle(org.apache.poi.ss.usermodel.Sheet sheet, org.apache.poi.ss.util.CellRangeAddress cellRangeAddress, org.apache.poi.ss.usermodel.CellStyle style) 渲染合并单元格样式- 参数:
sheet- 工作表cellRangeAddress- 合并单元格区域style- 单元格样式
-
setCellStyleAlignmentCenter
public static void setCellStyleAlignmentCenter(org.apache.poi.ss.usermodel.CellStyle cellStyle) 设置单元格水平居中,垂直居中对齐- 参数:
cellStyle- 单元格样式
-
setCellStyleAlignment
public static void setCellStyleAlignment(org.apache.poi.ss.usermodel.CellStyle cellStyle, org.apache.poi.ss.usermodel.HorizontalAlignment horizontalAlignment, org.apache.poi.ss.usermodel.VerticalAlignment verticalAlignment) 设置单元格对齐方式- 参数:
cellStyle- 单元格样式horizontalAlignment- 水平对齐方式verticalAlignment- 垂直对齐方式
-
createWorkBookFont
public static org.apache.poi.ss.usermodel.Font createWorkBookFont(org.apache.poi.ss.usermodel.Workbook workbook, String fontName, boolean bold, short fontSize, org.apache.poi.ss.usermodel.IndexedColors fontColor) 创建工作簿字体- 参数:
workbook- 工作簿fontName- 字体名称bold- 是否加粗fontSize- 字体大小fontColor- 字体颜色
-
createCellStyle
public static org.apache.poi.ss.usermodel.CellStyle createCellStyle(org.apache.poi.ss.usermodel.Workbook workbook, org.apache.poi.ss.usermodel.BorderStyle borderStyle, org.apache.poi.ss.usermodel.IndexedColors borderColor, AxolotlColor foregroundColor, org.apache.poi.ss.usermodel.Font font) 创建通用的单元格样式- 参数:
workbook- 工作表borderStyle- 边框样式borderColor- 边框颜色- 返回:
- 单元格样式
-
createCellStyle
public static org.apache.poi.ss.usermodel.CellStyle createCellStyle(org.apache.poi.ss.usermodel.Workbook workbook, org.apache.poi.ss.usermodel.BorderStyle borderStyle, org.apache.poi.ss.usermodel.IndexedColors borderColor, AxolotlColor foregroundColor) 创建具有指定边框样式、边框颜色、前景色的单元格样式。- 参数:
workbook- 工作簿对象,用于创建单元格样式。borderStyle- 边框样式,定义单元格边框的样式。borderColor- 边框颜色,从IndexedColors中选择颜色。foregroundColor- 前景色,定义单元格内的文字或图案颜色。- 返回:
- 返回配置好的单元格样式对象。
-
createStandardCellStyle
public static org.apache.poi.ss.usermodel.CellStyle createStandardCellStyle(org.apache.poi.ss.usermodel.Workbook workbook, org.apache.poi.ss.usermodel.BorderStyle borderStyle, org.apache.poi.ss.usermodel.IndexedColors borderColor, AxolotlColor foregroundColor, org.apache.poi.ss.usermodel.Font font) 创建标准单元格样式- 参数:
workbook- 工作簿borderStyle- 边框样式borderColor- 边框颜色foregroundColor- 背景颜色font- 字体- 返回:
-
setCellAsPlainText
public static void setCellAsPlainText(org.apache.poi.ss.usermodel.CellStyle cellStyle) 设置单元格为纯文本- 参数:
cellStyle- 单元格样式
-