Browse Source

Merge pull request #14035 in DESIGN/design from bugfix/11.0 to feature/x

* commit 'b4b6acaaecbc3e5f60c82e6d657add7592c7abc1':
  REPORT-115178 fix:模板主题管理显示被截断
  REPORT-119406 fix:设计器数据脱敏国际化显示不全,影响使用
  REPORT-116546 编辑图片控件之后,cpt模板切换到frm卡住 【问题原因】图片控件的listener没有eventName,会产生NPE,导致UI卡顿 【改动思路】判断eventName是否为空
feature/x
superman 6 months ago
parent
commit
2d97a24e1b
  1. 35
      designer-base/src/main/java/com/fr/design/data/datapane/preview/desensitization/view/rule/DesensitizationRuleEditPane.java
  2. 3
      designer-base/src/main/java/com/fr/design/gui/controlpane/UIListGroupControlPane.java
  3. 2
      designer-base/src/main/java/com/fr/design/utils/DesignUtils.java

35
designer-base/src/main/java/com/fr/design/data/datapane/preview/desensitization/view/rule/DesensitizationRuleEditPane.java

@ -1,5 +1,7 @@
package com.fr.design.data.datapane.preview.desensitization.view.rule; package com.fr.design.data.datapane.preview.desensitization.view.rule;
import com.fine.swing.ui.layout.Column;
import com.fine.swing.ui.layout.Layouts;
import com.fr.data.desensitize.rule.base.DesensitizationCondition; import com.fr.data.desensitize.rule.base.DesensitizationCondition;
import com.fr.data.desensitize.rule.base.DesensitizationRule; import com.fr.data.desensitize.rule.base.DesensitizationRule;
import com.fr.data.desensitize.rule.base.DesensitizationRuleSource; import com.fr.data.desensitize.rule.base.DesensitizationRuleSource;
@ -28,6 +30,10 @@ import java.awt.event.FocusListener;
import java.util.Arrays; import java.util.Arrays;
import java.util.Set; import java.util.Set;
import static com.fine.swing.ui.layout.Layouts.cell;
import static com.fine.swing.ui.layout.Layouts.column;
import static com.fine.swing.ui.layout.Layouts.row;
/** /**
* 脱敏规则编辑页 * 脱敏规则编辑页
* *
@ -157,26 +163,29 @@ public class DesensitizationRuleEditPane extends BasicBeanPane<DesensitizationRu
JPanel panel = FRGUIPaneFactory.createBorderLayout_S_Pane(); JPanel panel = FRGUIPaneFactory.createBorderLayout_S_Pane();
cardLayout = new CardLayout(); cardLayout = new CardLayout();
ruleConditionPane = new JPanel(cardLayout); ruleConditionPane = new JPanel(cardLayout);
// 字符替换
JPanel characterReplacePane = FRGUIPaneFactory.createLeftFlowZeroGapBorderPane();
UILabel retainFrontLabel = new UILabel(Toolkit.i18nText("Fine-Design_Report_Desensitization_Part_One") + StringUtils.BLANK);
retainFrontTextField = new UINumberField(5); retainFrontTextField = new UINumberField(5);
retainFrontTextField.addFocusListener(retainFrontListener); retainFrontTextField.addFocusListener(retainFrontListener);
UILabel retainBackLabel = new UILabel(StringUtils.BLANK + Toolkit.i18nText("Fine-Design_Report_Desensitization_Part_Two") + StringUtils.BLANK);
retainBackTextField = new UINumberField(5); retainBackTextField = new UINumberField(5);
retainBackTextField.addFocusListener(retainBackListener); retainBackTextField.addFocusListener(retainBackListener);
UILabel replaceLabel = new UILabel(StringUtils.BLANK + Toolkit.i18nText("Fine-Design_Report_Desensitization_Part_Three") + StringUtils.BLANK);
firstSymbolTextField = new UITextField(10); firstSymbolTextField = new UITextField(10);
firstSymbolTextField.addFocusListener(firstSymbolListener); firstSymbolTextField.addFocusListener(firstSymbolListener);
// 字符替换
characterReplacePane.add(retainFrontLabel); Layouts.Cell<Column> column = column(
characterReplacePane.add(retainFrontTextField); 4,
characterReplacePane.add(retainBackLabel); row(
characterReplacePane.add(retainBackTextField); cell(new UILabel(Toolkit.i18nText("Fine-Design_Report_Desensitization_Part_One") + StringUtils.BLANK)),
characterReplacePane.add(replaceLabel); cell(retainFrontTextField),
characterReplacePane.add(firstSymbolTextField); cell(new UILabel(StringUtils.BLANK + Toolkit.i18nText("Fine-Design_Report_Desensitization_Part_Two") + StringUtils.BLANK)),
cell(retainBackTextField),
cell(new UILabel(StringUtils.BLANK + Toolkit.i18nText("Fine-Design_Report_Desensitization_Part_Four") + StringUtils.BLANK))
),
row(
cell(new UILabel(Toolkit.i18nText("Fine-Design_Report_Desensitization_Part_Three") + StringUtils.BLANK)),
cell(firstSymbolTextField)
)
);
// 整体替换 // 整体替换
JPanel characterAllReplacePane = FRGUIPaneFactory.createLeftFlowZeroGapBorderPane(); JPanel characterAllReplacePane = FRGUIPaneFactory.createLeftFlowZeroGapBorderPane();
UILabel allReplaceLabel = new UILabel(Toolkit.i18nText("Fine-Design_Report_Desensitization_All_Character_Replace_By") + StringUtils.BLANK); UILabel allReplaceLabel = new UILabel(Toolkit.i18nText("Fine-Design_Report_Desensitization_All_Character_Replace_By") + StringUtils.BLANK);
@ -186,7 +195,7 @@ public class DesensitizationRuleEditPane extends BasicBeanPane<DesensitizationRu
characterAllReplacePane.add(allReplaceLabel); characterAllReplacePane.add(allReplaceLabel);
characterAllReplacePane.add(secondSymbolTextField); characterAllReplacePane.add(secondSymbolTextField);
ruleConditionPane.add(characterReplacePane, DesensitizationRuleType.CHARACTER_REPLACE.getRuleTypeName()); ruleConditionPane.add(column.getComponent(), DesensitizationRuleType.CHARACTER_REPLACE.getRuleTypeName());
ruleConditionPane.add(characterAllReplacePane, DesensitizationRuleType.ALL_CHARACTERS_REPLACE.getRuleTypeName()); ruleConditionPane.add(characterAllReplacePane, DesensitizationRuleType.ALL_CHARACTERS_REPLACE.getRuleTypeName());
// 初始化状态为字符替换 // 初始化状态为字符替换
switchRuleConditionPane(DesensitizationRuleType.CHARACTER_REPLACE); switchRuleConditionPane(DesensitizationRuleType.CHARACTER_REPLACE);

3
designer-base/src/main/java/com/fr/design/gui/controlpane/UIListGroupControlPane.java

@ -118,6 +118,9 @@ public abstract class UIListGroupControlPane extends UIControlPane implements Li
for (int i = 0, size = widget.getListenerSize(); i < size; i++) { for (int i = 0, size = widget.getListenerSize(); i < size; i++) {
Listener listener = widget.getListener(i); Listener listener = widget.getListener(i);
if (!listener.isDefault()) { if (!listener.isDefault()) {
if (StringUtils.isEmpty(listener.getEventName())) {
continue;
}
String eventName = switchLang(listener.getEventName()) + (nameObjectList.size() + 1); String eventName = switchLang(listener.getEventName()) + (nameObjectList.size() + 1);
NameObject nameObject = new NameObject(eventName, listener); NameObject nameObject = new NameObject(eventName, listener);
nameObjectList.add(nameObject); nameObjectList.add(nameObject);

2
designer-base/src/main/java/com/fr/design/utils/DesignUtils.java

@ -345,7 +345,7 @@ public class DesignUtils {
@Override @Override
protected FRFont compute() { protected FRFont compute() {
FRFont guiFRFont; FRFont guiFRFont;
Locale defaultLocale = Locale.getDefault(); Locale defaultLocale = GeneralContext.getLocale();
// JDK9 之后宋体在计算label中字母的空间上出现问题,暂时先用雅黑兼容,以后再统一字体 // JDK9 之后宋体在计算label中字母的空间上出现问题,暂时先用雅黑兼容,以后再统一字体
if (StableUtils.getMajorJavaVersion() >= 9 && OperatingSystem.isWindows()) { if (StableUtils.getMajorJavaVersion() >= 9 && OperatingSystem.isWindows()) {
guiFRFont = getNamedFont("Microsoft YaHei"); guiFRFont = getNamedFont("Microsoft YaHei");

Loading…
Cancel
Save