add setFreezePane

This commit is contained in:
Looly 2020-03-30 10:38:15 +08:00
parent 3eaf4702f5
commit 2783f17472
3 changed files with 48 additions and 0 deletions

View File

@ -48,6 +48,17 @@ public final class JSONUtil {
return new JSONObject();
}
/**
* 创建JSONObject
*
* @param config JSON配置
* @return JSONObject
* @since 5.2.5
*/
public static JSONObject createObj(JSONConfig config) {
return new JSONObject(config);
}
/**
* 创建 JSONArray
*
@ -57,6 +68,17 @@ public final class JSONUtil {
return new JSONArray();
}
/**
* 创建 JSONArray
*
* @param config JSON配置
* @return JSONArray
* @since 5.2.5
*/
public static JSONArray createArray(JSONConfig config) {
return new JSONArray(config);
}
/**
* JSON字符串转JSONObject对象
*

View File

@ -470,6 +470,30 @@ public class ExcelWriter extends ExcelBase<ExcelWriter> {
return this;
}
/**
* 设置窗口冻结之前冻结的窗口会被覆盖如果rowSplit为0表示取消冻结
*
* @param rowSplit 冻结的行及行数2表示前两行
* @return this
* @since 5.2.5
*/
public ExcelWriter setFreezePane(int rowSplit){
return setFreezePane(0, rowSplit);
}
/**
* 设置窗口冻结之前冻结的窗口会被覆盖如果colSplit和rowSplit为0表示取消冻结
*
* @param colSplit 冻结的列及列数2表示前两列
* @param rowSplit 冻结的行及行数2表示前两行
* @return this
* @since 5.2.5
*/
public ExcelWriter setFreezePane(int colSplit, int rowSplit){
getSheet().createFreezePane(colSplit, rowSplit);
return this;
}
/**
* 设置列宽单位为一个字符的宽度例如传入width为10表示10个字符的宽度
*

View File

@ -90,6 +90,8 @@ public class ExcelWriteTest {
// 一次性写出内容使用默认样式
writer.write(rows);
writer.autoSizeColumn(0, true);
//冻结前两行
writer.setFreezePane(0, 2);
// 关闭writer释放内存
writer.close();
}