|
|
|
@ -1,10 +1,7 @@
|
|
|
|
|
package com.fr.env; |
|
|
|
|
|
|
|
|
|
import com.fr.decision.update.data.UpdateConstants; |
|
|
|
|
import com.fr.decision.update.info.UpdateCallBack; |
|
|
|
|
import com.fr.decision.update.info.UpdateProgressCallBack; |
|
|
|
|
import com.fr.design.RestartHelper; |
|
|
|
|
import com.fr.design.VersionCheckUtils; |
|
|
|
|
import com.fr.design.dialog.FineJOptionPane; |
|
|
|
|
import com.fr.design.gui.ibutton.UIButton; |
|
|
|
|
import com.fr.design.gui.ilable.UILabel; |
|
|
|
@ -15,6 +12,7 @@ import com.fr.design.layout.TableLayoutHelper;
|
|
|
|
|
import com.fr.design.mainframe.DesignerContext; |
|
|
|
|
import com.fr.design.update.actions.SyncFileProcess; |
|
|
|
|
import com.fr.design.utils.gui.GUICoreUtils; |
|
|
|
|
import com.fr.design.versioncheck.VersionCheckUtils; |
|
|
|
|
import com.fr.general.CloudCenter; |
|
|
|
|
import com.fr.general.CloudCenterConfig; |
|
|
|
|
import com.fr.general.ComparatorUtils; |
|
|
|
@ -40,7 +38,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 +152,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}; |
|
|
|
@ -316,7 +313,6 @@ public class CheckServiceDialog extends JDialog implements ActionListener {
|
|
|
|
|
Toolkit.i18nText("Fine-Design_Basic_Confirm"), JOptionPane.YES_NO_OPTION, QUESTION_MESSAGE, IOUtils.readIcon("com/fr/design/icon/versioncheck/question.png"), option, 1); |
|
|
|
|
if (0 == a) { |
|
|
|
|
//jar包一致的话只更新插件
|
|
|
|
|
UpdateCallBack callBack = new UpdateProgressCallBack(progressBar); |
|
|
|
|
progressBar.setVisible(true); |
|
|
|
|
progressBar.setString(Toolkit.i18nText("Fine-Design_Update_Info_Wait_Message")); |
|
|
|
|
syncButton.setEnabled(false); |
|
|
|
@ -326,36 +322,17 @@ public class CheckServiceDialog extends JDialog implements ActionListener {
|
|
|
|
|
final JFrame frame = DesignerContext.getDesignerFrame(); |
|
|
|
|
final RestartHelper helper = new RestartHelper(); |
|
|
|
|
FineProcessContext.getParentPipe().fire(FineProcessEngineEvent.DESTROY); |
|
|
|
|
new SyncFileProcess(callBack, remoteBuildNo) { |
|
|
|
|
new SyncFileProcess(progressBar, remoteBuildNo) { |
|
|
|
|
@Override |
|
|
|
|
public void onDownloadSuccess() { |
|
|
|
|
deleteForDesignerUpdate(installLib); |
|
|
|
|
//主jar下载成功之后再卸载安装插件
|
|
|
|
|
progressBar.setString(Toolkit.i18nText("Fine-Design_Basic_Sync_Plugins")); |
|
|
|
|
progressBar.setValue(0); |
|
|
|
|
new SwingWorker<JSONArray, Void>() { |
|
|
|
|
|
|
|
|
|
@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 (syncFailedPlugins != null && syncFailedPlugins.size() > 0) { |
|
|
|
|
SyncFailedPluginsDialog syncFailedPluginsDialog = new SyncFailedPluginsDialog(DesignerContext.getDesignerFrame(), syncFailedPlugins); |
|
|
|
|
syncFailedPluginsDialog.setVisible(true); |
|
|
|
|
} |
|
|
|
|
helper.restartForUpdate(frame); |
|
|
|
|
} |
|
|
|
|
}.execute(); |
|
|
|
|
progressBar.setVisible(false); |
|
|
|
|
JSONArray syncFailedPlugins = VersionCheckUtils.getPluginsSyncFailed(differentPlugins); |
|
|
|
|
if (syncFailedPlugins.size() > 0) { |
|
|
|
|
SyncFailedPluginsDialog syncFailedPluginsDialog = new SyncFailedPluginsDialog(DesignerContext.getDesignerFrame(), syncFailedPlugins); |
|
|
|
|
syncFailedPluginsDialog.setVisible(true); |
|
|
|
|
} |
|
|
|
|
helper.restartForUpdate(frame); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
@ -369,13 +346,14 @@ public class CheckServiceDialog extends JDialog implements ActionListener {
|
|
|
|
|
}.execute(); |
|
|
|
|
} else { |
|
|
|
|
//到这边说明主jar是一致的,就只尝试同步插件
|
|
|
|
|
progressBar.setString(Toolkit.i18nText("Fine-Design_Basic_Sync_Plugins")); |
|
|
|
|
progressBar.setValue(0); |
|
|
|
|
new SwingWorker<JSONArray, Void>() { |
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
|
protected JSONArray doInBackground() { |
|
|
|
|
return VersionCheckUtils.syncPlugins(differentPlugins); |
|
|
|
|
progressBar.setString(Toolkit.i18nText("Fine-Design_Basic_Sync_Plugins")); |
|
|
|
|
progressBar.setValue(0); |
|
|
|
|
VersionCheckUtils.syncPlugins(differentPlugins); |
|
|
|
|
return VersionCheckUtils.getPluginsSyncFailed(differentPlugins); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
|