From a9ca1e5700d3f06ff440ef949337ebf28032a420 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=96=B9=E7=A3=8A?= <294531121@qq.com> Date: Fri, 22 Oct 2021 22:36:31 +0800 Subject: [PATCH 1/2] =?UTF-8?q?REPORT-60538=20=E8=8B=B1=E6=97=A5=E9=9F=A9?= =?UTF-8?q?=E7=8E=AF=E5=A2=83=E6=9C=AA=E5=B1=8F=E8=94=BD=E5=9C=A8=E7=BA=BF?= =?UTF-8?q?=E7=BB=84=E4=BB=B6=E5=BA=93?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/fr/design/mainframe/FormWidgetDetailPane.java | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/designer-form/src/main/java/com/fr/design/mainframe/FormWidgetDetailPane.java b/designer-form/src/main/java/com/fr/design/mainframe/FormWidgetDetailPane.java index 1db9c38c3..309594a67 100644 --- a/designer-form/src/main/java/com/fr/design/mainframe/FormWidgetDetailPane.java +++ b/designer-form/src/main/java/com/fr/design/mainframe/FormWidgetDetailPane.java @@ -10,6 +10,7 @@ import com.fr.design.mainframe.reuse.ComponentReuseNotificationInfo; import com.fr.design.mainframe.share.collect.ComponentCollector; import com.fr.design.mainframe.share.ui.local.LocalWidgetRepoPane; import com.fr.design.mainframe.share.ui.online.OnlineWidgetRepoPane; +import com.fr.general.GeneralContext; import javax.swing.BorderFactory; import javax.swing.Icon; @@ -174,7 +175,8 @@ public class FormWidgetDetailPane extends FormDockView{ private void initPaneList() { paneList = new ArrayList<>(); paneList.add(LocalWidgetRepoPane.getInstance()); - paneList.add(OnlineWidgetRepoPane.getInstance()); + if (GeneralContext.isChineseEnv()) { + paneList.add(OnlineWidgetRepoPane.getInstance()); + } } - } From 2aa50641b5cec8c6086d3881bc118606ae72d1a0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=96=B9=E7=A3=8A?= <294531121@qq.com> Date: Mon, 25 Oct 2021 10:12:57 +0800 Subject: [PATCH 2/2] =?UTF-8?q?REPORT-60538=20=E6=94=B9=E7=94=A8LocaleCent?= =?UTF-8?q?er=E5=9B=BD=E9=99=85=E5=8C=96=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../design/locale/impl/OnlineWidgetsMark.java | 26 +++++++++++++++++++ .../mainframe/FormWidgetDetailPane.java | 11 +++++++- 2 files changed, 36 insertions(+), 1 deletion(-) create mode 100644 designer-base/src/main/java/com/fr/design/locale/impl/OnlineWidgetsMark.java diff --git a/designer-base/src/main/java/com/fr/design/locale/impl/OnlineWidgetsMark.java b/designer-base/src/main/java/com/fr/design/locale/impl/OnlineWidgetsMark.java new file mode 100644 index 000000000..f5614fed9 --- /dev/null +++ b/designer-base/src/main/java/com/fr/design/locale/impl/OnlineWidgetsMark.java @@ -0,0 +1,26 @@ +package com.fr.design.locale.impl; + +import com.fr.general.GeneralContext; +import com.fr.general.locale.LocaleMark; + +import java.util.HashMap; +import java.util.Locale; +import java.util.Map; + +public class OnlineWidgetsMark implements LocaleMark { + private Map map = new HashMap<>(); + + public OnlineWidgetsMark() { + map.put(Locale.CHINA, true); + map.put(Locale.TAIWAN, true); + map.put(Locale.US, false); + map.put(Locale.KOREA, false); + map.put(Locale.JAPAN, false); + } + + @Override + public Boolean getValue() { + Boolean result = map.get(GeneralContext.getLocale()); + return result == null ? false : result; + } +} diff --git a/designer-form/src/main/java/com/fr/design/mainframe/FormWidgetDetailPane.java b/designer-form/src/main/java/com/fr/design/mainframe/FormWidgetDetailPane.java index f2268c86c..75f4b2692 100644 --- a/designer-form/src/main/java/com/fr/design/mainframe/FormWidgetDetailPane.java +++ b/designer-form/src/main/java/com/fr/design/mainframe/FormWidgetDetailPane.java @@ -6,10 +6,13 @@ import com.fr.design.gui.ibutton.UIHeadGroup; import com.fr.design.gui.ilable.UILabel; import com.fr.design.i18n.Toolkit; import com.fr.design.layout.FRGUIPaneFactory; +import com.fr.design.locale.impl.OnlineWidgetsMark; import com.fr.design.mainframe.reuse.ComponentReuseNotificationInfo; import com.fr.design.mainframe.share.collect.ComponentCollector; import com.fr.design.mainframe.share.ui.local.LocalWidgetRepoPane; import com.fr.design.mainframe.share.ui.online.OnlineWidgetRepoPane; +import com.fr.general.locale.LocaleCenter; +import com.fr.general.locale.LocaleMark; import javax.swing.BorderFactory; import javax.swing.Icon; @@ -173,7 +176,13 @@ public class FormWidgetDetailPane extends FormDockView{ private void initPaneList() { paneList = new ArrayList<>(); paneList.add(LocalWidgetRepoPane.getInstance()); - paneList.add(OnlineWidgetRepoPane.getInstance()); + if (isShowOnlineWidgetRepoPane()) { + paneList.add(OnlineWidgetRepoPane.getInstance()); + } } + private boolean isShowOnlineWidgetRepoPane() { + LocaleMark mark = LocaleCenter.getMark(OnlineWidgetsMark.class); + return mark.getValue(); + } }