diff --git a/designer-base/src/main/java/com/fr/design/mainframe/share/ComponentShareUtil.java b/designer-base/src/main/java/com/fr/design/mainframe/share/ComponentShareUtil.java index dbf9839935..cec7fbc8fc 100644 --- a/designer-base/src/main/java/com/fr/design/mainframe/share/ComponentShareUtil.java +++ b/designer-base/src/main/java/com/fr/design/mainframe/share/ComponentShareUtil.java @@ -2,11 +2,14 @@ package com.fr.design.mainframe.share; import com.fr.design.DesignerEnvManager; import com.fr.design.file.HistoryTemplateListCache; +import com.fr.design.locale.impl.ShowOnlineWidgetMark; import com.fr.design.mainframe.JTemplate; import com.fr.design.mainframe.reuse.ComponentReuseNotificationInfo; import com.fr.form.share.constants.ComponentPath; import com.fr.form.share.group.filter.ReuFilter; import com.fr.design.DesignerCloudURLManager; +import com.fr.general.locale.LocaleCenter; +import com.fr.general.locale.LocaleMark; import com.fr.workspace.WorkContext; /** @@ -23,7 +26,12 @@ public class ComponentShareUtil { * @return */ public static boolean needSwitch2OnlineTab() { - return DesignerCloudURLManager.getInstance().isConnected() && !hasTouched() && isCurrentTplNewCreate(); + return DesignerCloudURLManager.getInstance().isConnected() && !hasTouched() && isCurrentTplNewCreate() && isShowOnlineWidgetRepoPane(); + } + + public static boolean isShowOnlineWidgetRepoPane() { + LocaleMark localeMark = LocaleCenter.getMark(ShowOnlineWidgetMark.class); + return localeMark.getValue(); } /** 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 93427ab2bb..5453ca61da 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,13 +6,11 @@ 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.share.collect.ComponentCollector; import com.fr.design.mainframe.share.ComponentShareUtil; +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; import javax.swing.JPanel; @@ -190,14 +188,9 @@ public class FormWidgetDetailPane extends FormDockView { private void initPaneList() { paneList = new ArrayList<>(); paneList.add(LocalWidgetRepoPane.getInstance()); - if (isShowOnlineWidgetRepoPane()) { + if (ComponentShareUtil.isShowOnlineWidgetRepoPane()) { OnlineWidgetRepoPane.getInstance().refresh(); paneList.add(OnlineWidgetRepoPane.getInstance()); } } - - private boolean isShowOnlineWidgetRepoPane() { - LocaleMark localeMark = LocaleCenter.getMark(ShowOnlineWidgetMark.class); - return localeMark.getValue(); - } }