From c424f95a568d21a99c96e510b9cd4d3e17b244a3 Mon Sep 17 00:00:00 2001 From: "Destiny.Lin" Date: Wed, 10 Jan 2024 18:46:03 +0800 Subject: [PATCH] =?UTF-8?q?REPORT-113064=20=E8=B6=85=E9=93=BE-=E7=BD=91?= =?UTF-8?q?=E7=BB=9C=E6=8A=A5=E8=A1=A8=EF=BC=8C=E5=8D=A1=E9=A1=BF=E4=BF=AE?= =?UTF-8?q?=E5=A4=8D=E6=95=88=E6=9E=9C=E4=B8=8D=E6=98=8E=E6=98=BE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../gui/itree/filetree/ReportletPane.java | 25 +++++++++++++++++-- 1 file changed, 23 insertions(+), 2 deletions(-) diff --git a/designer-base/src/main/java/com/fr/design/gui/itree/filetree/ReportletPane.java b/designer-base/src/main/java/com/fr/design/gui/itree/filetree/ReportletPane.java index b6724d9632..f509976f26 100644 --- a/designer-base/src/main/java/com/fr/design/gui/itree/filetree/ReportletPane.java +++ b/designer-base/src/main/java/com/fr/design/gui/itree/filetree/ReportletPane.java @@ -3,6 +3,7 @@ package com.fr.design.gui.itree.filetree; import com.fr.design.dialog.BasicPane; import com.fr.design.file.TemplateTreePane; import com.fr.design.gui.ibutton.UIButton; +import com.fr.design.gui.ilable.UILabel; import com.fr.design.gui.itextarea.UITextArea; import com.fr.design.layout.FRGUIPaneFactory; import com.fr.design.utils.DesignUtils; @@ -11,6 +12,7 @@ import com.fr.file.filetree.IOFileNodeFilter; import javax.swing.JPanel; import javax.swing.JScrollPane; +import javax.swing.SwingWorker; import java.awt.BorderLayout; import java.awt.CardLayout; import java.awt.Font; @@ -23,6 +25,8 @@ public class ReportletPane extends BasicPane { private ClassFileTree classReportletTree; private JScrollPane c_panel; + private JScrollPane loadPanel; + private UIButton switchButton; private CardLayout card; private JPanel cardPane; @@ -59,8 +63,13 @@ public class ReportletPane extends BasicPane { cardPane.add(t_panel = new JScrollPane(templateReportletTree), "TEMPLATE"); classReportletTree = new ClassFileTree(); cardPane.add(c_panel = new JScrollPane(classReportletTree), "CLASS"); + JPanel panel = new JPanel(); + panel.add(new UILabel("loading...")); + cardPane.add(loadPanel = new JScrollPane(panel), "LOADING"); - this.refreshEnv(); + // 初始化的时候没有采用到Class面板,没必要这里就刷新,这里只需要刷template面板就行 + TemplateFileTree tree = TemplateTreePane.getInstance().getTemplateFileTree(); + this.templateReportletTree.setModel(tree.getModel()); } /* @@ -68,8 +77,20 @@ public class ReportletPane extends BasicPane { */ private void switchCardPane(boolean switch2Class) { if (switch2Class) { - card.show(cardPane, "CLASS"); + card.show(cardPane, "LOADING"); switchButton.setText(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Utils_Switch_To_Template_Reportlet")); + new SwingWorker() { + @Override + protected Void doInBackground() throws Exception { + classReportletTree.refreshEnv(); + return null; + } + @Override + protected void done() { + card.show(cardPane, "CLASS"); + + } + }.execute(); } else { card.show(cardPane, "TEMPLATE"); switchButton.setText(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Utils_Switch_To_Class_Reportlet"));