Browse Source

REPORT-58901 FR11-二轮回归-非中文 设计器启动时闪退

【问题原因】
1. 国际化翻译还未进行,导致使用的内置主题国际化名称为空,进而
获取相关主题的时候无法找到

2.主题单元格样式也存在类似的问题,国际化只能在主题启动时进行,
在使用时就不能使用国际化key获取特定样式,否则切换应用语言的
情况下,将无法获取到该特定单元格样式

3. 删除主题单元格中没用的字段

【改动思路】
同上
persist/11.0
Starryi 3 years ago
parent
commit
a40589755a
  1. 16
      designer-base/src/main/java/com/fr/design/mainframe/theme/edit/CellStyleListEditPane.java
  2. 19
      designer-base/src/main/java/com/fr/design/mainframe/theme/preview/ecpreview/AbstractECPreviewPane.java
  3. 2
      designer-base/src/main/java/com/fr/design/mainframe/theme/utils/DefaultThemedTemplateCellElementCase.java

16
designer-base/src/main/java/com/fr/design/mainframe/theme/edit/CellStyleListEditPane.java

@ -229,7 +229,7 @@ public class CellStyleListEditPane extends JListControlPane {
if (selectModel != null) {
NameObject selectNameObject = (NameObject) selectModel.wrapper;
ThemedCellStyle cellStyle = (ThemedCellStyle) (selectNameObject.getObject());
this.shortCut.setEnabled(cellStyle.isRemovable() && !cellStyle.isDefault4New());
this.shortCut.setEnabled(cellStyle.isRemovable() && !cellStyle.isUse4Default());
} else {
this.shortCut.setEnabled(false);
}
@ -266,9 +266,13 @@ public class CellStyleListEditPane extends JListControlPane {
cellStyle.setName(menuName);
cellStyle.setStyle(Style.getInstance());
cellStyle.setRemovable(true);
cellStyle.setImmutable(true);
cellStyle.setDefault4Absent(false);
cellStyle.setDefault4New(false);
cellStyle.setUse4Default(false);
cellStyle.setUse4BigTitle(false);
cellStyle.setUse4SmallTitle(false);
cellStyle.setUse4Header(false);
cellStyle.setUse4MainText(false);
cellStyle.setUse4SupportInfo(false);
cellStyle.setUse4HighlightText(false);
return new NameObject(helper.createUnrepeatedName(this.menuName()), cellStyle);
}
@ -285,7 +289,7 @@ public class CellStyleListEditPane extends JListControlPane {
}
public boolean acceptNameObject(Object ob) {
return !((ThemedCellStyle) ob).isDefault4New();
return !((ThemedCellStyle) ob).isUse4Default();
}
}
@ -297,7 +301,7 @@ public class CellStyleListEditPane extends JListControlPane {
@Override
public boolean acceptNameObject(Object ob) {
return ((ThemedCellStyle) ob).isDefault4New();
return ((ThemedCellStyle) ob).isUse4Default();
}
}
}

19
designer-base/src/main/java/com/fr/design/mainframe/theme/preview/ecpreview/AbstractECPreviewPane.java

@ -4,38 +4,35 @@ import com.fr.base.Style;
import com.fr.base.theme.TemplateTheme;
import com.fr.base.theme.settings.ThemedCellStyle;
import com.fr.base.theme.settings.ThemedCellStyleList;
import com.fr.design.i18n.Toolkit;
import com.fr.design.mainframe.theme.preview.ThemePreviewed;
import com.fr.design.mainframe.theme.preview.UINoOpaquePanel;
import com.fr.design.mainframe.theme.preview.ecpreview.cell.AbstractPreviewCell;
import com.fr.design.mainframe.theme.preview.ecpreview.cell.PreviewCell;
import javax.swing.JPanel;
import java.util.List;
public abstract class AbstractECPreviewPane extends UINoOpaquePanel implements ThemePreviewed<TemplateTheme> {
protected Style getReportHeaderStyle(ThemedCellStyleList cellStyleList) {
return getCellStyle(cellStyleList, Toolkit.i18nText("Fine-Design_Basic_Predefined_Style_Header"));
return getCellStyle(cellStyleList.getUse4Header());
}
protected Style getMainContentStyle(ThemedCellStyleList cellStyleList) {
return getCellStyle(cellStyleList, Toolkit.i18nText("Fine-Design_Basic_Predefined_Style_Main_Text"));
return getCellStyle(cellStyleList.getUse4MainText());
}
protected Style getHighLightStyle(ThemedCellStyleList cellStyleList) {
return getCellStyle(cellStyleList, Toolkit.i18nText("Fine-Design_Basic_Predefined_Style_Highlight_Text"));
return getCellStyle(cellStyleList.getUse4HighlightText());
}
protected Style getSmallTitleStyle(ThemedCellStyleList cellStyleList) {
return getCellStyle(cellStyleList, Toolkit.i18nText("Fine-Design_Basic_Predefined_Style_Small_Title"));
return getCellStyle(cellStyleList.getUse4SmallTitle());
}
private Style getCellStyle(ThemedCellStyleList cellStyleList, String styleName) {
ThemedCellStyle cellStyle = cellStyleList.find(styleName);
if (cellStyle == null) {
private Style getCellStyle(ThemedCellStyle themedCellStyle) {
if (themedCellStyle == null) {
return Style.DEFAULT_STYLE;
}
return cellStyle.getStyle();
Style style = themedCellStyle.getStyle();
return style != null ? style : Style.DEFAULT_STYLE;
}
protected void refresh(List<AbstractPreviewCell> list, Style style) {

2
designer-base/src/main/java/com/fr/design/mainframe/theme/utils/DefaultThemedTemplateCellElementCase.java

@ -34,7 +34,7 @@ public class DefaultThemedTemplateCellElementCase {
JTemplate<?,?> template = HistoryTemplateListCache.getInstance().getCurrentEditingTemplate();
if (template != null) {
TemplateTheme theme = template.getTemplateTheme();
ThemedCellStyle themedCellStyle = theme.getCellStyleList().getDefaultCellStyle4New();
ThemedCellStyle themedCellStyle = theme.getCellStyleList().getUse4Default();
if (themedCellStyle != null) {
NameStyle nameStyle = NameStyle.getPassiveInstance(themedCellStyle.getName(), themedCellStyle.getStyle());
cellElement.setStyle(nameStyle);

Loading…
Cancel
Save