Hoky
3 years ago
39 changed files with 193 additions and 142 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