From ed0a2090dfec25615df88d308d72eeb91870f694 Mon Sep 17 00:00:00 2001 From: Tommy Date: Fri, 19 Nov 2021 09:49:03 +0800 Subject: [PATCH 1/2] =?UTF-8?q?REPORT-62896=20=E4=B8=8B=E8=BD=BD=E4=B8=BB?= =?UTF-8?q?=E9=A2=98=E5=BC=95=E5=AF=BC=E8=BF=87=E7=A8=8B=E4=B8=AD=E6=A6=82?= =?UTF-8?q?=E7=8E=87=E6=80=A7=E9=80=80=E5=87=BA=E5=BC=95=E5=AF=BC=E9=97=AE?= =?UTF-8?q?=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../mainframe/FormWidgetDetailPane.java | 6 ++--- .../theme/DownloadComponentPackageGuide.java | 27 ++++++++++++------- 2 files changed, 21 insertions(+), 12 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 7b4e3c2e0..eb7e9e583 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 @@ -140,11 +140,11 @@ public class FormWidgetDetailPane extends FormDockView{ } public void switch2Local() { - cardLayout.show(centerPane, paneList.get(0).getTitle()); + headGroup.setSelectedIndex(0); } - public void swich2Online() { - cardLayout.show(centerPane, paneList.get(1).getTitle()); + public void switch2Online() { + headGroup.setSelectedIndex(ONLINE_TAB); } private UILabel tipLabel(String text) { diff --git a/designer-realize/src/main/java/com/fr/design/mainframe/guide/creator/theme/DownloadComponentPackageGuide.java b/designer-realize/src/main/java/com/fr/design/mainframe/guide/creator/theme/DownloadComponentPackageGuide.java index 5d878a3c2..5215f232b 100644 --- a/designer-realize/src/main/java/com/fr/design/mainframe/guide/creator/theme/DownloadComponentPackageGuide.java +++ b/designer-realize/src/main/java/com/fr/design/mainframe/guide/creator/theme/DownloadComponentPackageGuide.java @@ -29,6 +29,7 @@ import com.fr.design.mainframe.guide.tip.GuideTip; import com.fr.design.mainframe.share.ui.block.OnlineWidgetPackageBlock; import com.fr.design.mainframe.share.ui.online.OnlineWidgetRepoPane; import com.fr.design.mainframe.share.ui.online.OnlineWidgetTabPane; +import com.fr.design.mainframe.share.ui.online.widgetpackage.OnlineWidgetPackagesShowPane; import com.fr.design.mainframe.share.util.DownloadUtils; import com.fr.design.utils.ComponentUtils; import com.fr.form.share.utils.ShareUtils; @@ -102,22 +103,23 @@ public class DownloadComponentPackageGuide { EastRegionContainerPane.getInstance().showContainer(); EastRegionContainerPane.getInstance().switchTabTo(EastRegionContainerPane.KEY_WIDGET_SETTINGS); OnlineWidgetRepoPane onlineWidgetRepoPane = OnlineWidgetRepoPane.getInstance(); - onlineWidgetRepoPane.setContent(); - OnlineWidgetTabPane tabPane = (OnlineWidgetTabPane) ComponentUtils.findComponentByClass(onlineWidgetRepoPane, OnlineWidgetTabPane.class); - UITabGroup tabGroup = (UITabGroup) ComponentUtils.findComponentByClass(tabPane, UITabGroup.class); - JPanel centerPane = (JPanel) tabPane.getComponent(1); - if (centerPane.getComponentCount() > 0) { + Component onlineWidgetPackagesShowPane = ComponentUtils.findComponentByClass(onlineWidgetRepoPane, OnlineWidgetPackagesShowPane.class); + if (onlineWidgetPackagesShowPane != null) { GuideManager.getInstance().getCurrentGuide().start(); } else { + onlineWidgetRepoPane.setContent(); + OnlineWidgetTabPane tabPane = (OnlineWidgetTabPane) ComponentUtils.findComponentByClass(onlineWidgetRepoPane, OnlineWidgetTabPane.class); + JPanel centerPane = (JPanel) tabPane.getComponent(1); centerPane.addContainerListener(new ContainerAdapter() { @Override public void componentAdded(ContainerEvent e) { - GuideManager.getInstance().getCurrentGuide().start(); + if (e.getChild() instanceof OnlineWidgetPackagesShowPane) { + GuideManager.getInstance().getCurrentGuide().start(); + } } }); } - tabGroup.setSelectedIndex(1); - tabGroup.tabChanged(1); + switch2OnlinePackageBlock(); } else { GuideCreateUtils.showNoNetworkAlert(); GuideManager.getInstance().getCurrentGuide().terminate(); @@ -168,7 +170,7 @@ public class DownloadComponentPackageGuide { @Override public boolean onComplete() { - FormWidgetDetailPane.getInstance().swich2Online(); + FormWidgetDetailPane.getInstance().switch2Online(); return true; } }); @@ -298,4 +300,11 @@ public class DownloadComponentPackageGuide { themeConfirmDialog.dispose(); } } + + private static void switch2OnlinePackageBlock() { + OnlineWidgetTabPane tabPane = (OnlineWidgetTabPane) ComponentUtils.findComponentByClass(OnlineWidgetRepoPane.getInstance(), OnlineWidgetTabPane.class); + UITabGroup tabGroup = (UITabGroup) ComponentUtils.findComponentByClass(tabPane, UITabGroup.class); + tabGroup.setSelectedIndex(1); + tabGroup.tabChanged(1); + } } From dbb9bb6ce7083fb2b0cebbaee3206db3238ff75f Mon Sep 17 00:00:00 2001 From: Tommy Date: Fri, 19 Nov 2021 09:53:52 +0800 Subject: [PATCH 2/2] =?UTF-8?q?REPORT-62896=20=E6=9B=BF=E6=8D=A2=E5=B8=B8?= =?UTF-8?q?=E9=87=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/fr/design/mainframe/FormWidgetDetailPane.java | 5 +++-- 1 file changed, 3 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 eb7e9e583..7e8cd6710 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 @@ -31,6 +31,7 @@ import java.util.List; * Time: 下午8:18 */ public class FormWidgetDetailPane extends FormDockView{ + private static final int LOCAL_TAB = 0; private static final int ONLINE_TAB = 1; private JPanel centerPane; @@ -104,7 +105,7 @@ public class FormWidgetDetailPane extends FormDockView{ cardLayout.show(centerPane, paneList.get(newSelectedIndex).getTitle()); } }; - headGroup.setSelectedIndex(ComponentReuseNotificationInfo.getInstance().isClickedWidgetLib() ? 0 : ONLINE_TAB); + headGroup.setSelectedIndex(ComponentReuseNotificationInfo.getInstance().isClickedWidgetLib() ? LOCAL_TAB : ONLINE_TAB); this.add(headGroup, BorderLayout.NORTH); this.add(centerPane, BorderLayout.CENTER); } @@ -140,7 +141,7 @@ public class FormWidgetDetailPane extends FormDockView{ } public void switch2Local() { - headGroup.setSelectedIndex(0); + headGroup.setSelectedIndex(LOCAL_TAB); } public void switch2Online() {