From 7afb74076d4c927875e2c7e4eed9593721a8a823 Mon Sep 17 00:00:00 2001 From: Harrison Date: Tue, 28 Aug 2018 17:36:53 +0800 Subject: [PATCH] =?UTF-8?q?REPORT-10923=E3=80=9010.0=E5=86=92=E7=83=9F?= =?UTF-8?q?=E3=80=91=E5=8D=95=E5=85=83=E6=A0=BC=E5=85=83=E7=B4=A0=E6=B1=87?= =?UTF-8?q?=E6=80=BB=E4=B8=8B=E5=90=84=E9=80=89=E9=A1=B9=E7=9A=84=E5=9B=BD?= =?UTF-8?q?=E9=99=85=E5=8C=96=E9=97=AE=E9=A2=98=20REPORT-10924=E3=80=9010.?= =?UTF-8?q?0=E5=86=92=E7=83=9F=E3=80=91=E5=8D=95=E5=85=83=E6=A0=BC?= =?UTF-8?q?=E5=85=83=E7=B4=A0=E3=80=8B=E9=AB=98=E7=BA=A7=E3=80=8B=E7=BB=93?= =?UTF-8?q?=E6=9E=9C=E9=9B=86=E7=AD=9B=E9=80=89=E9=80=89=E9=A1=B9=E4=B8=AD?= =?UTF-8?q?=E7=9A=84=E5=9B=BD=E9=99=85=E5=8C=96=E9=97=AE=E9=A2=98=20REPORT?= =?UTF-8?q?-10920=E3=80=9010.0=E5=86=92=E7=83=9F=E3=80=91=E8=A1=A8?= =?UTF-8?q?=E5=8D=95=E4=B8=AD=E6=B7=BB=E5=8A=A0Tab=E5=9D=97=EF=BC=8C?= =?UTF-8?q?=E5=8F=B3=E4=BE=A7=E9=9D=A2=E6=9D=BF=E7=9A=84=E5=9B=BD=E9=99=85?= =?UTF-8?q?=E5=8C=96=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../gui/icombobox/FunctionComboBox.java | 11 ++--- .../utils/gui/FunctionClassMappingUtils.java | 43 +++++++++++++++++++ .../cellquick/CellDSColumnEditor.java | 2 +- 3 files changed, 50 insertions(+), 6 deletions(-) create mode 100644 designer-base/src/main/java/com/fr/design/utils/gui/FunctionClassMappingUtils.java diff --git a/designer-base/src/main/java/com/fr/design/gui/icombobox/FunctionComboBox.java b/designer-base/src/main/java/com/fr/design/gui/icombobox/FunctionComboBox.java index a5da615b0c..74db09f921 100644 --- a/designer-base/src/main/java/com/fr/design/gui/icombobox/FunctionComboBox.java +++ b/designer-base/src/main/java/com/fr/design/gui/icombobox/FunctionComboBox.java @@ -3,13 +3,13 @@ */ package com.fr.design.gui.icombobox; -import java.awt.Component; +import com.fr.data.core.DataCoreUtils; +import com.fr.data.util.function.DataFunction; +import com.fr.design.utils.gui.FunctionClassMappingUtils; import javax.swing.DefaultComboBoxModel; import javax.swing.JList; - -import com.fr.data.core.DataCoreUtils; -import com.fr.data.util.function.DataFunction; +import java.awt.Component; /** * DataFunction combobox. @@ -60,7 +60,8 @@ public class FunctionComboBox extends UIComboBox { if (value instanceof DataFunction) { DataFunction function = (DataFunction) value; - this.setText(" " + DataCoreUtils.getFunctionDisplayName(function)); + String functionBriefName = DataCoreUtils.getFunctionBriefName(function); + this.setText(com.fr.design.i18n.Toolkit.i18nText(FunctionClassMappingUtils.getLocaleKey(functionBriefName))); } return this; diff --git a/designer-base/src/main/java/com/fr/design/utils/gui/FunctionClassMappingUtils.java b/designer-base/src/main/java/com/fr/design/utils/gui/FunctionClassMappingUtils.java new file mode 100644 index 0000000000..374f953b99 --- /dev/null +++ b/designer-base/src/main/java/com/fr/design/utils/gui/FunctionClassMappingUtils.java @@ -0,0 +1,43 @@ +package com.fr.design.utils.gui; + +import com.fr.stable.StringUtils; + +/** + * @author: Harrison + * @date: 2018/08/28 + * @description: 为 Function 类的名字做匹配, 从而方便国际化的类 + **/ +public enum FunctionClassMappingUtils { + DataFunction_Sum("Sum", "Fine-Design_DataFunction_Sum"), + DataFunction_Average("Average","Fine-Design_DataFunction_Average"), + DataFunction_Max("Max","Fine-Design_DataFunction_Max"), + DataFunction_Min("Min","Fine-Design_DataFunction_Min"), + DataFunction_Count("Count","Fine-Design_DataFunction_Count"), + DataFunction_None("None","Fine-Design_DataFunction_None"); + + private final String functionClassName; + private final String localeKey; + + FunctionClassMappingUtils(String functionClassName, String localeKey) { + this.functionClassName = functionClassName; + this.localeKey = localeKey; + } + + public String getFunctionClassName() { + return functionClassName; + } + + public String getLocaleKey() { + return localeKey; + } + + public static String getLocaleKey(String functionClassName) { + for (FunctionClassMappingUtils value : FunctionClassMappingUtils.values()) { + if (StringUtils.equals(value.getFunctionClassName(), functionClassName)) { + return value.getLocaleKey(); + } + } + return functionClassName; + } + +} diff --git a/designer-realize/src/main/java/com/fr/quickeditor/cellquick/CellDSColumnEditor.java b/designer-realize/src/main/java/com/fr/quickeditor/cellquick/CellDSColumnEditor.java index 8825f517a1..98e89738ee 100644 --- a/designer-realize/src/main/java/com/fr/quickeditor/cellquick/CellDSColumnEditor.java +++ b/designer-realize/src/main/java/com/fr/quickeditor/cellquick/CellDSColumnEditor.java @@ -856,7 +856,7 @@ public class CellDSColumnEditor extends CellQuickEditor { com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Bind_Column_Top_N"), com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Bind_Column_Bottom_N"), com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Odd"), - com.fr.design.i18n.Toolkit.i18nText("Even"), + com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Even"), com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Specify") }); rsComboBox.addActionListener(actionListener);