Browse Source
Merge in DESIGN/design from ~STARRYI/design:release/11.0 to release/11.0 * commit '5f17d510648b8a750807a9e9fc895d8ce2e6a734': REPORT-58398 【主题切换】新单元格的默认样式确定 REPORT-58536 【主题切换】新建cpt,增加sheet页,设计器里主题配置的背景只在第一个sheet生效 REPORT-58403 【主题切换】组件右侧边框标题部分,间距有点大 REPORT-58411 【FR11二轮回归】主题样式-body右侧设置面板按交互文档预期是提示“背景设置”,现在是“样式设置”fix-lag
starryi
3 years ago
36 changed files with 135 additions and 85 deletions
@ -0,0 +1,45 @@ |
|||||||
|
package com.fr.design.mainframe.theme.utils; |
||||||
|
|
||||||
|
import com.fr.base.NameStyle; |
||||||
|
import com.fr.base.theme.TemplateTheme; |
||||||
|
import com.fr.base.theme.settings.ThemedCellStyle; |
||||||
|
import com.fr.design.file.HistoryTemplateListCache; |
||||||
|
import com.fr.design.mainframe.JTemplate; |
||||||
|
import com.fr.report.cell.DefaultTemplateCellElement; |
||||||
|
|
||||||
|
/** |
||||||
|
* @author Starryi |
||||||
|
* @version 1.0 |
||||||
|
* Created by Starryi on 2021/8/31 |
||||||
|
*/ |
||||||
|
public class DefaultThemedTemplateCellElementCase { |
||||||
|
|
||||||
|
public static DefaultTemplateCellElement createInstance() { |
||||||
|
return themingCellElement(new DefaultTemplateCellElement()); |
||||||
|
} |
||||||
|
|
||||||
|
public static DefaultTemplateCellElement createInstance(int column, int row) { |
||||||
|
return themingCellElement(new DefaultTemplateCellElement(column, row)); |
||||||
|
} |
||||||
|
|
||||||
|
public static DefaultTemplateCellElement createInstance(int column, int row, Object value) { |
||||||
|
return themingCellElement(new DefaultTemplateCellElement(column, row, value)); |
||||||
|
} |
||||||
|
|
||||||
|
public static DefaultTemplateCellElement createInstance(int column, int row, int columnSpan, int rowSpan, Object value) { |
||||||
|
return themingCellElement(new DefaultTemplateCellElement(column, row, columnSpan, rowSpan, value)); |
||||||
|
} |
||||||
|
|
||||||
|
private static DefaultTemplateCellElement themingCellElement(DefaultTemplateCellElement cellElement) { |
||||||
|
JTemplate<?,?> template = HistoryTemplateListCache.getInstance().getCurrentEditingTemplate(); |
||||||
|
if (template != null) { |
||||||
|
TemplateTheme theme = template.getTemplateTheme(); |
||||||
|
ThemedCellStyle themedCellStyle = theme.getCellStyleList().getDefaultCellStyle4New(); |
||||||
|
if (themedCellStyle != null) { |
||||||
|
NameStyle nameStyle = NameStyle.getPassiveInstance(themedCellStyle.getName(), themedCellStyle.getStyle()); |
||||||
|
cellElement.setStyle(nameStyle); |
||||||
|
} |
||||||
|
} |
||||||
|
return cellElement; |
||||||
|
} |
||||||
|
} |
Loading…
Reference in new issue