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] =?UTF-8?q?REPORT-60538=20=E6=94=B9=E7=94=A8LocaleCenter?= =?UTF-8?q?=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 0000000000..f5614fed9e --- /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 f2268c86cf..75f4b2692d 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(); + } }