@@ -122,9 +122,21 @@ This section describes common issues that may arise when using this project.
122122- ** A:** You can customize cell styles by implementing the ` WriteHandler ` interface. For example:
123123
124124 ``` java
125- public class CustomCellStyleWriteHandler extends AbstractCellStyleWriteHandler {
125+ public class CustomCellStyleWriteHandler extends AbstractCellStyleStrategy {
126+
126127 @Override
127- protected void setCellStyle (Cell cell , Head head , Integer relativeRowIndex ) {
128+ public int order () {
129+ // Customize the execution order
130+ return OrderConstant . SHEET_ORDER ;
131+ }
132+
133+ @Override
134+ protected void setHeadCellStyle (CellWriteHandlerContext context ) {
135+ // Customize the head cell style
136+ }
137+
138+ @Override
139+ protected void setContentCellStyle (Cell cell , Head head , Integer relativeRowIndex ) {
128140 CellStyle style = cell. getSheet(). getWorkbook(). createCellStyle();
129141 style. setFillForegroundColor(IndexedColors . RED. getIndex());
130142 style. setFillPattern(FillPatternType . SOLID_FOREGROUND );
@@ -274,14 +286,26 @@ This section describes common issues that may arise when using this project.
274286- ** A:** You can customize the header style by implementing the ` WriteHandler ` interface. For example:
275287
276288 ``` java
277- public class CustomHeadStyleWriteHandler extends AbstractHeadStyleWriteHandler {
289+ public class CustomHeadStyleWriteHandler extends AbstractCellStyleStrategy {
290+
291+ @Override
292+ public int order () {
293+ // Customize the execution order
294+ return OrderConstant . SHEET_ORDER ;
295+ }
296+
278297 @Override
279298 protected void setHeadCellStyle (Cell cell , Head head , Integer relativeRowIndex ) {
280299 CellStyle style = cell. getSheet(). getWorkbook(). createCellStyle();
281300 style. setFillForegroundColor(IndexedColors . YELLOW. getIndex());
282301 style. setFillPattern(FillPatternType . SOLID_FOREGROUND );
283302 cell. setCellStyle(style);
284303 }
304+
305+ @Override
306+ protected void setContentCellStyle (Cell cell , Head head , Integer relativeRowIndex ) {
307+ // Customize the content cell style
308+ }
285309 }
286310 ```
287311
@@ -316,9 +340,21 @@ This section describes common issues that may arise when using this project.
316340- ** A:** You can set the font by creating a ` Font ` object and applying it to the ` CellStyle ` . For example:
317341
318342 ``` java
319- public class CustomFontWriteHandler extends AbstractCellStyleWriteHandler {
343+ public class CustomFontWriteHandler extends AbstractCellStyleStrategy {
344+
345+ @Override
346+ public int order () {
347+ // Customize the execution order
348+ return OrderConstant . SHEET_ORDER ;
349+ }
350+
351+ @Override
352+ protected void setHeadCellStyle (CellWriteHandlerContext context ) {
353+ // Customize the head cell style
354+ }
355+
320356 @Override
321- protected void setCellStyle (Cell cell , Head head , Integer relativeRowIndex ) {
357+ protected void setContentCellStyle (Cell cell , Head head , Integer relativeRowIndex ) {
322358 Workbook workbook = cell. getSheet(). getWorkbook();
323359 Font font = workbook. createFont();
324360 font. setFontName(" Arial" );
0 commit comments