Skip to content

Commit 5f30766

Browse files
fix: correct wrong class reference in website documentation (#838)
1 parent e278935 commit 5f30766

2 files changed

Lines changed: 82 additions & 10 deletions

File tree

  • website
    • docs/sheet/help
    • i18n/zh-cn/docusaurus-plugin-content-docs/current/sheet/help

website/docs/sheet/help/faq.md

Lines changed: 41 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -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");

website/i18n/zh-cn/docusaurus-plugin-content-docs/current/sheet/help/faq.md

Lines changed: 41 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -107,9 +107,21 @@ title: '常见问题'
107107
- **A:** 可以通过实现`WriteHandler`接口来自定义单元格样式。例如:
108108

109109
```java
110-
public class CustomCellStyleWriteHandler extends AbstractCellStyleWriteHandler {
110+
public class CustomCellStyleWriteHandler extends AbstractCellStyleStrategy {
111+
111112
@Override
112-
protected void setCellStyle(Cell cell, Head head, Integer relativeRowIndex) {
113+
public int order() {
114+
// 自定义执行顺序
115+
return OrderConstant.SHEET_ORDER;
116+
}
117+
118+
@Override
119+
protected void setHeadCellStyle(CellWriteHandlerContext context) {
120+
// 自定义表头单元格样式
121+
}
122+
123+
@Override
124+
protected void setContentCellStyle(Cell cell, Head head, Integer relativeRowIndex) {
113125
CellStyle style = cell.getSheet().getWorkbook().createCellStyle();
114126
style.setFillForegroundColor(IndexedColors.RED.getIndex());
115127
style.setFillPattern(FillPatternType.SOLID_FOREGROUND);
@@ -257,14 +269,26 @@ title: '常见问题'
257269
- **A:** 可以通过实现`WriteHandler`接口来自定义表头样式。例如:
258270

259271
```java
260-
public class CustomHeadStyleWriteHandler extends AbstractHeadStyleWriteHandler {
272+
public class CustomHeadStyleWriteHandler extends AbstractCellStyleStrategy {
273+
274+
@Override
275+
public int order() {
276+
// 自定义执行顺序
277+
return OrderConstant.SHEET_ORDER;
278+
}
279+
261280
@Override
262281
protected void setHeadCellStyle(Cell cell, Head head, Integer relativeRowIndex) {
263282
CellStyle style = cell.getSheet().getWorkbook().createCellStyle();
264283
style.setFillForegroundColor(IndexedColors.YELLOW.getIndex());
265284
style.setFillPattern(FillPatternType.SOLID_FOREGROUND);
266285
cell.setCellStyle(style);
267286
}
287+
288+
@Override
289+
protected void setContentCellStyle(Cell cell, Head head, Integer relativeRowIndex) {
290+
// 自定义内容单元格样式
291+
}
268292
}
269293
```
270294

@@ -299,9 +323,21 @@ title: '常见问题'
299323
- **A:** 可以通过创建`Font`对象并应用到`CellStyle`中来设置字体。例如:
300324

301325
```java
302-
public class CustomFontWriteHandler extends AbstractCellStyleWriteHandler {
326+
public class CustomFontWriteHandler extends AbstractCellStyleStrategy {
327+
328+
@Override
329+
public int order() {
330+
// 自定义执行顺序
331+
return OrderConstant.SHEET_ORDER;
332+
}
333+
334+
@Override
335+
protected void setHeadCellStyle(CellWriteHandlerContext context) {
336+
// 自定义表头单元格样式
337+
}
338+
303339
@Override
304-
protected void setCellStyle(Cell cell, Head head, Integer relativeRowIndex) {
340+
protected void setContentCellStyle(Cell cell, Head head, Integer relativeRowIndex) {
305341
Workbook workbook = cell.getSheet().getWorkbook();
306342
Font font = workbook.createFont();
307343
font.setFontName("Arial");

0 commit comments

Comments
 (0)