From 7edab03d094468cb90ded27c6a86e793f7ad6588 Mon Sep 17 00:00:00 2001 From: pengda Date: Tue, 8 Jun 2021 15:36:53 +0800 Subject: [PATCH] =?UTF-8?q?REPORT-53601=20&=20REPORT-53614=20=20=E7=BB=93?= =?UTF-8?q?=E6=9E=9C=E6=96=87=E6=9C=AC=E6=A1=86=E6=A1=86=E8=AE=BE=E7=BD=AE?= =?UTF-8?q?=E4=B8=8D=E5=8F=AF=E7=BC=96=E8=BE=91=E3=80=82=E8=BF=9B=E5=BA=A6?= =?UTF-8?q?=E6=9D=A1=E6=9B=B4=E6=96=B0=E8=AE=BE=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/fr/env/CheckServiceDialog.java | 59 ++++++++++--------- .../com/fr/env/SyncFailedPluginsDialog.java | 1 + 2 files changed, 32 insertions(+), 28 deletions(-) diff --git a/designer-base/src/main/java/com/fr/env/CheckServiceDialog.java b/designer-base/src/main/java/com/fr/env/CheckServiceDialog.java index 3a4612699..062b20acd 100644 --- a/designer-base/src/main/java/com/fr/env/CheckServiceDialog.java +++ b/designer-base/src/main/java/com/fr/env/CheckServiceDialog.java @@ -40,7 +40,6 @@ import java.awt.event.MouseEvent; import java.awt.event.MouseListener; import java.io.File; import java.util.List; -import java.util.concurrent.ExecutionException; import javax.swing.BorderFactory; import javax.swing.Icon; import javax.swing.JDialog; @@ -155,7 +154,7 @@ public class CheckServiceDialog extends JDialog implements ActionListener { detailsComponents = new Component[][]{{jarCheckTitleLabel}, {jarCheckResultLabel}, {affectedFunctionsLabel}, {affectedFunctionsDetailsPane}, {pluginCheckTitleLabel}, {pluginsCheckResultPanel}}; hideAffectedFunctionsComponents = new Component[][]{{jarCheckTitleLabel}, {jarCheckResultLabel}, {affectedFunctionsLabel}, {pluginCheckTitleLabel}, {pluginsCheckResultPanel}}; if (noExistServiceDescription.size() > 0 && !ComparatorUtils.equals(remoteBranch, localBranch)) { - detailsRowSize = new double[]{p, p, p, p,p,p}; + detailsRowSize = new double[]{p, p, p, p, p, p}; detailsInnerPane = TableLayoutHelper.createTableLayoutPane(detailsComponents, detailsRowSize, detailsColumnSize); } else { detailsRowSize = new double[]{p, p, 0, 0, p, p}; @@ -330,32 +329,36 @@ public class CheckServiceDialog extends JDialog implements ActionListener { @Override public void onDownloadSuccess() { deleteForDesignerUpdate(installLib); - //主jar下载成功之后再卸载安装插件 - progressBar.setString(Toolkit.i18nText("Fine-Design_Basic_Sync_Plugins")); - progressBar.setValue(0); - new SwingWorker() { - - @Override - protected JSONArray doInBackground() { - return VersionCheckUtils.syncPlugins(differentPlugins); - } - - @Override - protected void done() { - progressBar.setVisible(false); - JSONArray syncFailedPlugins = null; - try { - syncFailedPlugins = get(); - } catch (Exception ex) { - FineLoggerFactory.getLogger().error(ex.getMessage(), ex); + if (differentPlugins.size() > 0) { + //主jar下载成功之后再卸载安装插件 + new SwingWorker() { + + @Override + protected JSONArray doInBackground() { + progressBar.setString(Toolkit.i18nText("Fine-Design_Basic_Sync_Plugins")); + progressBar.setValue(0); + return VersionCheckUtils.syncPlugins(differentPlugins); } - if (syncFailedPlugins != null && syncFailedPlugins.size() > 0) { - SyncFailedPluginsDialog syncFailedPluginsDialog = new SyncFailedPluginsDialog(DesignerContext.getDesignerFrame(), syncFailedPlugins); - syncFailedPluginsDialog.setVisible(true); + + @Override + protected void done() { + progressBar.setVisible(false); + JSONArray syncFailedPlugins = null; + try { + syncFailedPlugins = get(); + } catch (Exception ex) { + FineLoggerFactory.getLogger().error(ex.getMessage(), ex); + } + if (syncFailedPlugins != null && syncFailedPlugins.size() > 0) { + SyncFailedPluginsDialog syncFailedPluginsDialog = new SyncFailedPluginsDialog(DesignerContext.getDesignerFrame(), syncFailedPlugins); + syncFailedPluginsDialog.setVisible(true); + } + helper.restartForUpdate(frame); } - helper.restartForUpdate(frame); - } - }.execute(); + }.execute(); + } else { + helper.restartForUpdate(frame); + } } @Override @@ -369,12 +372,12 @@ public class CheckServiceDialog extends JDialog implements ActionListener { }.execute(); } else { //到这边说明主jar是一致的,就只尝试同步插件 - progressBar.setString(Toolkit.i18nText("Fine-Design_Basic_Sync_Plugins")); - progressBar.setValue(0); new SwingWorker() { @Override protected JSONArray doInBackground() { + progressBar.setString(Toolkit.i18nText("Fine-Design_Basic_Sync_Plugins")); + progressBar.setValue(0); return VersionCheckUtils.syncPlugins(differentPlugins); } diff --git a/designer-base/src/main/java/com/fr/env/SyncFailedPluginsDialog.java b/designer-base/src/main/java/com/fr/env/SyncFailedPluginsDialog.java index b9046e153..9bf63460d 100644 --- a/designer-base/src/main/java/com/fr/env/SyncFailedPluginsDialog.java +++ b/designer-base/src/main/java/com/fr/env/SyncFailedPluginsDialog.java @@ -77,6 +77,7 @@ public class SyncFailedPluginsDialog extends JDialog { detailsText.append(plugin.getString("name")).append(",").append(Toolkit.i18nText("Fine-Design_Basic_Sync_Server_Version")).append(plugin.getString("version")).append("\n"); } detailsTextArea.setText(detailsText.toString()); + detailsTextArea.setEditable(false); scrollPane = new JScrollPane(detailsTextArea); centerPanel.add(detailsTitlePanel,BorderLayout.NORTH); centerPanel.add(scrollPane,BorderLayout.CENTER);