From 58f85e4b10626e0ab1516d9bd37686df6b0b9327 Mon Sep 17 00:00:00 2001 From: shine Date: Mon, 7 Dec 2020 11:14:19 +0800 Subject: [PATCH 1/3] =?UTF-8?q?CHART-17231=20=E9=BB=98=E8=AE=A4=E4=B8=8D?= =?UTF-8?q?=E9=80=89=E4=B8=AD=20=E6=97=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/fr/extended/chart/UIComboBoxWithNone.java | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/designer-chart/src/main/java/com/fr/extended/chart/UIComboBoxWithNone.java b/designer-chart/src/main/java/com/fr/extended/chart/UIComboBoxWithNone.java index f20675066f..e44214833d 100644 --- a/designer-chart/src/main/java/com/fr/extended/chart/UIComboBoxWithNone.java +++ b/designer-chart/src/main/java/com/fr/extended/chart/UIComboBoxWithNone.java @@ -2,6 +2,8 @@ package com.fr.extended.chart; import com.fr.design.gui.icombobox.UIComboBox; import com.fr.design.i18n.Toolkit; +import com.fr.general.GeneralUtils; +import com.fr.stable.StringUtils; import java.util.List; @@ -17,6 +19,11 @@ public class UIComboBoxWithNone extends UIComboBox { public UIComboBoxWithNone() { super(); addDefaultItem(); + setDefaultSelectedItem(); + } + + protected void setDefaultSelectedItem() { + setSelectedItem(null); } @Override @@ -43,7 +50,9 @@ public class UIComboBoxWithNone extends UIComboBox { //找不到的都选中无。中文的无 英文下是none。 //改正:找不到的且anObject不是null的 全部选中无。 - if (getSelectedIndex() == -1 && anObject != null) { + //改正:找不到的且anObject不是null的且anObject不是空字符串的 全部选中无。 + if (getSelectedIndex() == -1 && StringUtils.isNotEmpty(GeneralUtils.objectToString(anObject))) { + //进到if的anObject一定是某个国际化环境下的无 super.setSelectedItem(getDefaultLocaleString()); } } From ee32c3b9fef5eb8ba1021b4a83d84e3f75e915bb Mon Sep 17 00:00:00 2001 From: shine Date: Mon, 7 Dec 2020 11:15:23 +0800 Subject: [PATCH 2/3] update --- .../src/main/java/com/fr/extended/chart/UIComboBoxWithNone.java | 1 - 1 file changed, 1 deletion(-) diff --git a/designer-chart/src/main/java/com/fr/extended/chart/UIComboBoxWithNone.java b/designer-chart/src/main/java/com/fr/extended/chart/UIComboBoxWithNone.java index e44214833d..0459cd7101 100644 --- a/designer-chart/src/main/java/com/fr/extended/chart/UIComboBoxWithNone.java +++ b/designer-chart/src/main/java/com/fr/extended/chart/UIComboBoxWithNone.java @@ -52,7 +52,6 @@ public class UIComboBoxWithNone extends UIComboBox { //改正:找不到的且anObject不是null的 全部选中无。 //改正:找不到的且anObject不是null的且anObject不是空字符串的 全部选中无。 if (getSelectedIndex() == -1 && StringUtils.isNotEmpty(GeneralUtils.objectToString(anObject))) { - //进到if的anObject一定是某个国际化环境下的无 super.setSelectedItem(getDefaultLocaleString()); } } From 0ff4a5e35910d7665975276eb249b4fa94506fd9 Mon Sep 17 00:00:00 2001 From: shine Date: Tue, 8 Dec 2020 11:41:09 +0800 Subject: [PATCH 3/3] =?UTF-8?q?=E4=BB=A3=E7=A0=81=E8=B4=A8=E9=87=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/java/com/fr/extended/chart/UIComboBoxWithNone.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/designer-chart/src/main/java/com/fr/extended/chart/UIComboBoxWithNone.java b/designer-chart/src/main/java/com/fr/extended/chart/UIComboBoxWithNone.java index 0459cd7101..65e7bbb43f 100644 --- a/designer-chart/src/main/java/com/fr/extended/chart/UIComboBoxWithNone.java +++ b/designer-chart/src/main/java/com/fr/extended/chart/UIComboBoxWithNone.java @@ -23,7 +23,7 @@ public class UIComboBoxWithNone extends UIComboBox { } protected void setDefaultSelectedItem() { - setSelectedItem(null); + setSelectedItem(StringUtils.EMPTY); } @Override