|
|
@ -1,10 +1,7 @@ |
|
|
|
package com.fr.env; |
|
|
|
package com.fr.env; |
|
|
|
|
|
|
|
|
|
|
|
import com.fr.decision.update.data.UpdateConstants; |
|
|
|
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.RestartHelper; |
|
|
|
import com.fr.design.VersionCheckUtils; |
|
|
|
|
|
|
|
import com.fr.design.dialog.FineJOptionPane; |
|
|
|
import com.fr.design.dialog.FineJOptionPane; |
|
|
|
import com.fr.design.gui.ibutton.UIButton; |
|
|
|
import com.fr.design.gui.ibutton.UIButton; |
|
|
|
import com.fr.design.gui.ilable.UILabel; |
|
|
|
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.mainframe.DesignerContext; |
|
|
|
import com.fr.design.update.actions.SyncFileProcess; |
|
|
|
import com.fr.design.update.actions.SyncFileProcess; |
|
|
|
import com.fr.design.utils.gui.GUICoreUtils; |
|
|
|
import com.fr.design.utils.gui.GUICoreUtils; |
|
|
|
|
|
|
|
import com.fr.design.versioncheck.VersionCheckUtils; |
|
|
|
import com.fr.general.CloudCenter; |
|
|
|
import com.fr.general.CloudCenter; |
|
|
|
import com.fr.general.CloudCenterConfig; |
|
|
|
import com.fr.general.CloudCenterConfig; |
|
|
|
import com.fr.general.ComparatorUtils; |
|
|
|
import com.fr.general.ComparatorUtils; |
|
|
@ -40,7 +38,6 @@ import java.awt.event.MouseEvent; |
|
|
|
import java.awt.event.MouseListener; |
|
|
|
import java.awt.event.MouseListener; |
|
|
|
import java.io.File; |
|
|
|
import java.io.File; |
|
|
|
import java.util.List; |
|
|
|
import java.util.List; |
|
|
|
import java.util.concurrent.ExecutionException; |
|
|
|
|
|
|
|
import javax.swing.BorderFactory; |
|
|
|
import javax.swing.BorderFactory; |
|
|
|
import javax.swing.Icon; |
|
|
|
import javax.swing.Icon; |
|
|
|
import javax.swing.JDialog; |
|
|
|
import javax.swing.JDialog; |
|
|
@ -155,7 +152,7 @@ public class CheckServiceDialog extends JDialog implements ActionListener { |
|
|
|
detailsComponents = new Component[][]{{jarCheckTitleLabel}, {jarCheckResultLabel}, {affectedFunctionsLabel}, {affectedFunctionsDetailsPane}, {pluginCheckTitleLabel}, {pluginsCheckResultPanel}}; |
|
|
|
detailsComponents = new Component[][]{{jarCheckTitleLabel}, {jarCheckResultLabel}, {affectedFunctionsLabel}, {affectedFunctionsDetailsPane}, {pluginCheckTitleLabel}, {pluginsCheckResultPanel}}; |
|
|
|
hideAffectedFunctionsComponents = new Component[][]{{jarCheckTitleLabel}, {jarCheckResultLabel}, {affectedFunctionsLabel}, {pluginCheckTitleLabel}, {pluginsCheckResultPanel}}; |
|
|
|
hideAffectedFunctionsComponents = new Component[][]{{jarCheckTitleLabel}, {jarCheckResultLabel}, {affectedFunctionsLabel}, {pluginCheckTitleLabel}, {pluginsCheckResultPanel}}; |
|
|
|
if (noExistServiceDescription.size() > 0 && !ComparatorUtils.equals(remoteBranch, localBranch)) { |
|
|
|
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); |
|
|
|
detailsInnerPane = TableLayoutHelper.createTableLayoutPane(detailsComponents, detailsRowSize, detailsColumnSize); |
|
|
|
} else { |
|
|
|
} else { |
|
|
|
detailsRowSize = new double[]{p, p, 0, 0, p, p}; |
|
|
|
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); |
|
|
|
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) { |
|
|
|
if (0 == a) { |
|
|
|
//jar包一致的话只更新插件
|
|
|
|
//jar包一致的话只更新插件
|
|
|
|
UpdateCallBack callBack = new UpdateProgressCallBack(progressBar); |
|
|
|
|
|
|
|
progressBar.setVisible(true); |
|
|
|
progressBar.setVisible(true); |
|
|
|
progressBar.setString(Toolkit.i18nText("Fine-Design_Update_Info_Wait_Message")); |
|
|
|
progressBar.setString(Toolkit.i18nText("Fine-Design_Update_Info_Wait_Message")); |
|
|
|
syncButton.setEnabled(false); |
|
|
|
syncButton.setEnabled(false); |
|
|
@ -326,36 +322,17 @@ public class CheckServiceDialog extends JDialog implements ActionListener { |
|
|
|
final JFrame frame = DesignerContext.getDesignerFrame(); |
|
|
|
final JFrame frame = DesignerContext.getDesignerFrame(); |
|
|
|
final RestartHelper helper = new RestartHelper(); |
|
|
|
final RestartHelper helper = new RestartHelper(); |
|
|
|
FineProcessContext.getParentPipe().fire(FineProcessEngineEvent.DESTROY); |
|
|
|
FineProcessContext.getParentPipe().fire(FineProcessEngineEvent.DESTROY); |
|
|
|
new SyncFileProcess(callBack, remoteBuildNo) { |
|
|
|
new SyncFileProcess(progressBar, remoteBuildNo) { |
|
|
|
@Override |
|
|
|
@Override |
|
|
|
public void onDownloadSuccess() { |
|
|
|
public void onDownloadSuccess() { |
|
|
|
deleteForDesignerUpdate(installLib); |
|
|
|
deleteForDesignerUpdate(installLib); |
|
|
|
//主jar下载成功之后再卸载安装插件
|
|
|
|
progressBar.setVisible(false); |
|
|
|
progressBar.setString(Toolkit.i18nText("Fine-Design_Basic_Sync_Plugins")); |
|
|
|
JSONArray syncFailedPlugins = VersionCheckUtils.getPluginsSyncFailed(differentPlugins); |
|
|
|
progressBar.setValue(0); |
|
|
|
if (syncFailedPlugins.size() > 0) { |
|
|
|
new SwingWorker<JSONArray, Void>() { |
|
|
|
SyncFailedPluginsDialog syncFailedPluginsDialog = new SyncFailedPluginsDialog(DesignerContext.getDesignerFrame(), syncFailedPlugins); |
|
|
|
|
|
|
|
syncFailedPluginsDialog.setVisible(true); |
|
|
|
@Override |
|
|
|
} |
|
|
|
protected JSONArray doInBackground() { |
|
|
|
helper.restartForUpdate(frame); |
|
|
|
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(); |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
@Override |
|
|
@ -369,13 +346,14 @@ public class CheckServiceDialog extends JDialog implements ActionListener { |
|
|
|
}.execute(); |
|
|
|
}.execute(); |
|
|
|
} else { |
|
|
|
} else { |
|
|
|
//到这边说明主jar是一致的,就只尝试同步插件
|
|
|
|
//到这边说明主jar是一致的,就只尝试同步插件
|
|
|
|
progressBar.setString(Toolkit.i18nText("Fine-Design_Basic_Sync_Plugins")); |
|
|
|
|
|
|
|
progressBar.setValue(0); |
|
|
|
|
|
|
|
new SwingWorker<JSONArray, Void>() { |
|
|
|
new SwingWorker<JSONArray, Void>() { |
|
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
@Override |
|
|
|
protected JSONArray doInBackground() { |
|
|
|
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 |
|
|
|
@Override |
|
|
|