Browse Source

REPORT-59077 【主题切换】配色修改对保存按钮有影响,可能导致内置主题被删掉

【问题原因】
主题配色编辑时需要刷新主题编辑面板以响应配色
变化,刷新是通过populateBean完成的,但同时
该方法会导致保存按钮和名称编辑框的状态被重置。

配色编辑希望更新的实际上只包括扩展色面板以及
下方的自定义编辑面板,如背景/单元格/组件样式
等

【改动思路】
同标题
fix-lag
Starryi 3 years ago
parent
commit
787c8e70b1
  1. 11
      designer-base/src/main/java/com/fr/design/mainframe/theme/FormThemeProfilePane.java
  2. 10
      designer-base/src/main/java/com/fr/design/mainframe/theme/ReportThemeProfilePane.java
  3. 21
      designer-base/src/main/java/com/fr/design/mainframe/theme/TemplateThemeProfilePane.java

11
designer-base/src/main/java/com/fr/design/mainframe/theme/FormThemeProfilePane.java

@ -59,17 +59,10 @@ public class FormThemeProfilePane extends TemplateThemeProfilePane<FormTheme> {
} }
@Override @Override
public void populateBean(FormTheme theme) { public void populateBean4CustomEditors(FormTheme theme) {
super.populateBean(theme); super.populateBean4CustomEditors(theme);
isPopulating = true;
formBodyStyleSettingPane.populateBean(theme.getBodyStyle()); formBodyStyleSettingPane.populateBean(theme.getBodyStyle());
componentStyleSettingPane.populateBean(theme.getComponentStyle()); componentStyleSettingPane.populateBean(theme.getComponentStyle());
themePreviewPane.refresh(theme);
isPopulating = false;
} }
@Override @Override

10
designer-base/src/main/java/com/fr/design/mainframe/theme/ReportThemeProfilePane.java

@ -35,15 +35,9 @@ public class ReportThemeProfilePane extends TemplateThemeProfilePane<ReportTheme
} }
@Override @Override
public void populateBean(ReportTheme theme) { public void populateBean4CustomEditors(ReportTheme theme) {
super.populateBean(theme); super.populateBean4CustomEditors(theme);
isPopulating = true;
reportBodyStyleSettingPane.populateBean(theme.getBodyStyle()); reportBodyStyleSettingPane.populateBean(theme.getBodyStyle());
themePreviewPane.refresh(theme);
isPopulating = false;
} }
@Override @Override

21
designer-base/src/main/java/com/fr/design/mainframe/theme/TemplateThemeProfilePane.java

@ -318,18 +318,15 @@ public abstract class TemplateThemeProfilePane<T extends TemplateTheme> extends
T theme = updateBean(); T theme = updateBean();
FineColorManager.traverse(theme, replaceByColorScheme); FineColorManager.traverse(theme, replaceByColorScheme);
populateBean(theme); populateBean4CustomEditors(theme);
//图表渐变色 //图表渐变色
chartStyleSettingPane.populateGradientBar(colors); chartStyleSettingPane.populateGradientBar(colors);
themePreviewPane.refresh(theme);
} }
public void populateBean(T theme) { public void populateBean(T theme) {
try { this.theme = theme;
this.theme = (T) theme.clone();
} catch (CloneNotSupportedException e) {
FineLoggerFactory.getLogger().error(e.getMessage(), e);
}
isPopulating = true; isPopulating = true;
String name = theme.getName(); String name = theme.getName();
@ -345,14 +342,20 @@ public abstract class TemplateThemeProfilePane<T extends TemplateTheme> extends
saveAsButton.setEnabled(!currentIsNewTheme); saveAsButton.setEnabled(!currentIsNewTheme);
} }
cellStyleSettingPane.populateBean(theme.getCellStyleList());
colorListPane.populate(theme.getColorScheme().getColors()); colorListPane.populate(theme.getColorScheme().getColors());
colorListExtendedPane.populate(colorListPane.update()); colorListExtendedPane.populate(colorListPane.update());
chartStyleSettingPane.populateBean(theme.getChartStyle());
populateBean4CustomEditors(theme);
themePreviewPane.refresh(theme); themePreviewPane.refresh(theme);
isPopulating = false; isPopulating = false;
} }
protected void populateBean4CustomEditors(T theme) {
cellStyleSettingPane.populateBean(theme.getCellStyleList());
chartStyleSettingPane.populateBean(theme.getChartStyle());
}
public T updateBean() { public T updateBean() {
if (theme == null) { if (theme == null) {
theme = config.createNewTheme(); theme = config.createNewTheme();

Loading…
Cancel
Save