From b4f8abd4fc81dcfe5ae8bc1bb0a3ffb6c3038a5a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=96=B9=E7=A3=8A?= <294531121@qq.com> Date: Thu, 17 Feb 2022 17:17:07 +0800 Subject: [PATCH] =?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=2011.0=20->=2010.0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../locale/impl/ShowOnlineWidgetMark.java | 26 +++++++++++++++++++ .../mainframe/FormWidgetDetailPane.java | 10 +++++++ 2 files changed, 36 insertions(+) create mode 100644 designer-base/src/main/java/com/fr/design/locale/impl/ShowOnlineWidgetMark.java diff --git a/designer-base/src/main/java/com/fr/design/locale/impl/ShowOnlineWidgetMark.java b/designer-base/src/main/java/com/fr/design/locale/impl/ShowOnlineWidgetMark.java new file mode 100644 index 0000000000..1cf4a61b6f --- /dev/null +++ b/designer-base/src/main/java/com/fr/design/locale/impl/ShowOnlineWidgetMark.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 ShowOnlineWidgetMark implements LocaleMark { + private Map map = new HashMap<>(); + + public ShowOnlineWidgetMark() { + 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; + } +} \ No newline at end of file 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 7b3d4d2391..55788ba270 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.ShowOnlineWidgetMark; 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; @@ -166,6 +169,13 @@ public class FormWidgetDetailPane extends FormDockView{ paneList = new ArrayList<>(); paneList.add(LocalWidgetRepoPane.getInstance()); paneList.add(OnlineWidgetRepoPane.getInstance()); + if (isShowOnlineWidgetRepoPane()) { + paneList.add(OnlineWidgetRepoPane.getInstance()); + } } + private boolean isShowOnlineWidgetRepoPane() { + LocaleMark localeMark = LocaleCenter.getMark(ShowOnlineWidgetMark.class); + return localeMark.getValue(); + } }