Browse Source

Pull request #4529: REPORT-53601 & REPORT-53614 结果文本框框设置不可编辑。进度条更新设置

Merge in DESIGN/design from ~PENGDA/design:feature/10.0 to feature/10.0

* commit 'c2b91aabf45f08aba95e9f324f6f90a24f0c2238':
  REPORT-53601 & REPORT-53614  结果文本框框设置不可编辑。进度条更新设置
  REPORT-53601 & REPORT-53614  结果文本框框设置不可编辑。进度条更新设置
  REPORT-53601 & REPORT-53614  结果文本框框设置不可编辑。进度条更新设置
feature/10.0
pengda 4 years ago
parent
commit
31cd8ef498
  1. 3
      designer-base/src/main/java/com/fr/design/EnvChangeEntrance.java
  2. 19
      designer-base/src/main/java/com/fr/design/update/actions/SyncFileProcess.java
  3. 17
      designer-base/src/main/java/com/fr/design/versioncheck/VersionCheckUtils.java
  4. 40
      designer-base/src/main/java/com/fr/env/CheckServiceDialog.java
  5. 1
      designer-base/src/main/java/com/fr/env/SyncFailedPluginsDialog.java
  6. 2
      designer-base/src/main/java/com/fr/env/VersionCheckMessageDialog.java
  7. 2
      designer-realize/src/main/java/com/fr/start/module/DesignerWorkspaceProvider.java

3
designer-base/src/main/java/com/fr/design/EnvChangeEntrance.java

@ -18,11 +18,10 @@ import com.fr.design.i18n.Toolkit;
import com.fr.design.mainframe.DesignerContext; import com.fr.design.mainframe.DesignerContext;
import com.fr.design.mainframe.JTemplate; import com.fr.design.mainframe.JTemplate;
import com.fr.design.utils.DesignUtils; import com.fr.design.utils.DesignUtils;
import com.fr.env.CheckServiceDialog; import com.fr.design.versioncheck.VersionCheckUtils;
import com.fr.env.EnvListPane; import com.fr.env.EnvListPane;
import com.fr.env.RemoteWorkspaceURL; import com.fr.env.RemoteWorkspaceURL;
import com.fr.env.TestConnectionResult; import com.fr.env.TestConnectionResult;
import com.fr.env.VersionCheckMessageDialog;
import com.fr.exit.DesignerExiter; import com.fr.exit.DesignerExiter;
import com.fr.general.ComparatorUtils; import com.fr.general.ComparatorUtils;
import com.fr.general.GeneralUtils; import com.fr.general.GeneralUtils;

19
designer-base/src/main/java/com/fr/design/update/actions/SyncFileProcess.java

@ -2,22 +2,33 @@ package com.fr.design.update.actions;
import com.fr.decision.update.SyncExecutor; import com.fr.decision.update.SyncExecutor;
import com.fr.decision.update.info.UpdateCallBack; import com.fr.decision.update.info.UpdateCallBack;
import com.fr.decision.update.info.UpdateProgressCallBack;
import com.fr.design.i18n.Toolkit;
import com.fr.design.versioncheck.VersionCheckUtils;
import com.fr.log.FineLoggerFactory; import com.fr.log.FineLoggerFactory;
import java.util.concurrent.ExecutionException; import java.util.concurrent.ExecutionException;
import javax.swing.JProgressBar;
import javax.swing.SwingWorker; import javax.swing.SwingWorker;
public abstract class SyncFileProcess extends SwingWorker<Boolean, Void> { public abstract class SyncFileProcess extends SwingWorker<Boolean, Void> {
private UpdateCallBack callBack;
private String buildNo; private String buildNo;
private JProgressBar bar;
public SyncFileProcess(UpdateCallBack callBack,String buildNo) { public SyncFileProcess(JProgressBar bar, String buildNo) {
this.callBack = callBack; this.bar = bar;
this.buildNo = buildNo; this.buildNo = buildNo;
} }
@Override @Override
protected Boolean doInBackground() throws Exception { protected Boolean doInBackground() throws Exception {
return SyncExecutor.getInstance().execute(callBack,buildNo); UpdateCallBack callBack = new UpdateProgressCallBack(bar);
boolean result = SyncExecutor.getInstance().execute(callBack, buildNo);
if (result) {
bar.setValue(0);
bar.setString(Toolkit.i18nText("Fine-Design_Basic_Sync_Plugins"));
VersionCheckUtils.syncPlugins(VersionCheckUtils.checkLocalAndRemotePlugin());
}
return result;
} }
@Override @Override

17
designer-base/src/main/java/com/fr/design/VersionCheckUtils.java → designer-base/src/main/java/com/fr/design/versioncheck/VersionCheckUtils.java

@ -1,11 +1,14 @@
package com.fr.design; package com.fr.design.versioncheck;
import com.fr.base.FRContext; import com.fr.base.FRContext;
import com.fr.design.DesignerEnvManager;
import com.fr.design.dialog.NotificationDialog;
import com.fr.design.env.DesignerWorkspaceInfo; import com.fr.design.env.DesignerWorkspaceInfo;
import com.fr.design.env.DesignerWorkspaceType; import com.fr.design.env.DesignerWorkspaceType;
import com.fr.design.env.RemoteWorkspace; import com.fr.design.env.RemoteWorkspace;
import com.fr.design.i18n.Toolkit; import com.fr.design.i18n.Toolkit;
import com.fr.design.mainframe.DesignerContext; import com.fr.design.mainframe.DesignerContext;
import com.fr.env.CheckServiceDialog;
import com.fr.env.VersionCheckMessageDialog; import com.fr.env.VersionCheckMessageDialog;
import com.fr.general.ComparatorUtils; import com.fr.general.ComparatorUtils;
import com.fr.general.GeneralUtils; import com.fr.general.GeneralUtils;
@ -30,6 +33,9 @@ import com.fr.workspace.engine.base.FineObjectPool;
import com.fr.workspace.engine.channel.http.FunctionalHttpRequest; import com.fr.workspace.engine.channel.http.FunctionalHttpRequest;
import com.fr.workspace.engine.exception.WorkspaceConnectionException; import com.fr.workspace.engine.exception.WorkspaceConnectionException;
import com.fr.workspace.engine.rpc.WorkspaceProxyPool; import com.fr.workspace.engine.rpc.WorkspaceProxyPool;
import java.awt.event.MouseAdapter;
import java.awt.event.MouseEvent;
import java.awt.event.MouseListener;
import java.lang.reflect.Method; import java.lang.reflect.Method;
import java.text.ParsePosition; import java.text.ParsePosition;
import java.text.SimpleDateFormat; import java.text.SimpleDateFormat;
@ -226,21 +232,21 @@ public class VersionCheckUtils {
} }
remotePlugin.put("type", INCONSISTENCY); remotePlugin.put("type", INCONSISTENCY);
} }
} } else {
remotePlugin.put("type", MISSING); remotePlugin.put("type", MISSING);
if (remotePlugin.getString(NAME) == null) { if (remotePlugin.getString(NAME) == null) {
remotePlugin.put(NAME, remotePlugin.getString("id")); remotePlugin.put(NAME, remotePlugin.getString("id"));
} }
}
differentPlugins.put(remotePlugin); differentPlugins.put(remotePlugin);
} }
return differentPlugins; return differentPlugins;
} }
public static JSONArray syncPlugins(JSONArray differentPlugins) { public static void syncPlugins(JSONArray differentPlugins) {
Set<String> uninstallFailed = uninstallPlugins(differentPlugins); Set<String> uninstallFailed = uninstallPlugins(differentPlugins);
List<PluginMarker> plugins = getSyncPlugins(differentPlugins, uninstallFailed); List<PluginMarker> plugins = getSyncPlugins(differentPlugins, uninstallFailed);
installPlugins(plugins); installPlugins(plugins);
return getPluginsSyncFailed(differentPlugins);
} }
private static List<PluginMarker> getSyncPlugins(JSONArray differentPlugins, Set<String> uninstallFailed) { private static List<PluginMarker> getSyncPlugins(JSONArray differentPlugins, Set<String> uninstallFailed) {
@ -296,7 +302,7 @@ public class VersionCheckUtils {
return uninstallFailedID; return uninstallFailedID;
} }
private static JSONArray getPluginsSyncFailed(JSONArray differentPlugins){ public static JSONArray getPluginsSyncFailed(JSONArray differentPlugins){
JSONArray pluginsNeedSync = JSONArray.create(); JSONArray pluginsNeedSync = JSONArray.create();
List<PluginContext> localPlugins = PluginManager.getContexts(); List<PluginContext> localPlugins = PluginManager.getContexts();
Map<String, String> localPluginsInfo = new HashMap<>(); Map<String, String> localPluginsInfo = new HashMap<>();
@ -326,6 +332,7 @@ public class VersionCheckUtils {
@Override @Override
public void done(PluginTaskResult result) { public void done(PluginTaskResult result) {
latch.countDown(); latch.countDown();
FineLoggerFactory.getLogger().info("installPlugin: " + result.getCurrentTask().getMarker().getPluginID());
} }
}); });
} }

40
designer-base/src/main/java/com/fr/env/CheckServiceDialog.java vendored

@ -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,37 +322,18 @@ 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.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); progressBar.setVisible(false);
JSONArray syncFailedPlugins = null; JSONArray syncFailedPlugins = VersionCheckUtils.getPluginsSyncFailed(differentPlugins);
try { if (syncFailedPlugins.size() > 0) {
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 syncFailedPluginsDialog = new SyncFailedPluginsDialog(DesignerContext.getDesignerFrame(), syncFailedPlugins);
syncFailedPluginsDialog.setVisible(true); syncFailedPluginsDialog.setVisible(true);
} }
helper.restartForUpdate(frame); helper.restartForUpdate(frame);
} }
}.execute();
}
@Override @Override
public void onDownloadFailed() { public void onDownloadFailed() {
@ -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

1
designer-base/src/main/java/com/fr/env/SyncFailedPluginsDialog.java vendored

@ -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"); 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.setText(detailsText.toString());
detailsTextArea.setEditable(false);
scrollPane = new JScrollPane(detailsTextArea); scrollPane = new JScrollPane(detailsTextArea);
centerPanel.add(detailsTitlePanel,BorderLayout.NORTH); centerPanel.add(detailsTitlePanel,BorderLayout.NORTH);
centerPanel.add(scrollPane,BorderLayout.CENTER); centerPanel.add(scrollPane,BorderLayout.CENTER);

2
designer-base/src/main/java/com/fr/env/VersionCheckMessageDialog.java vendored

@ -1,6 +1,6 @@
package com.fr.env; package com.fr.env;
import com.fr.design.VersionCheckUtils; import com.fr.design.versioncheck.VersionCheckUtils;
import com.fr.design.gui.ilable.UILabel; import com.fr.design.gui.ilable.UILabel;
import com.fr.design.i18n.Toolkit; import com.fr.design.i18n.Toolkit;
import com.fr.design.layout.FRGUIPaneFactory; import com.fr.design.layout.FRGUIPaneFactory;

2
designer-realize/src/main/java/com/fr/start/module/DesignerWorkspaceProvider.java

@ -2,7 +2,6 @@ package com.fr.start.module;
import com.fr.design.DesignerEnvManager; import com.fr.design.DesignerEnvManager;
import com.fr.design.EnvChangeEntrance; import com.fr.design.EnvChangeEntrance;
import com.fr.design.VersionCheckUtils;
import com.fr.design.constants.DesignerLaunchStatus; import com.fr.design.constants.DesignerLaunchStatus;
import com.fr.design.editlock.ConnectionLockChangeChecker; import com.fr.design.editlock.ConnectionLockChangeChecker;
import com.fr.design.editlock.ServerTableDataLockChangeChecker; import com.fr.design.editlock.ServerTableDataLockChangeChecker;
@ -10,6 +9,7 @@ import com.fr.design.env.DesignerWorkspaceGenerator;
import com.fr.design.env.DesignerWorkspaceInfo; import com.fr.design.env.DesignerWorkspaceInfo;
import com.fr.design.env.LocalDesignerWorkspaceInfo; import com.fr.design.env.LocalDesignerWorkspaceInfo;
import com.fr.design.i18n.Toolkit; import com.fr.design.i18n.Toolkit;
import com.fr.design.versioncheck.VersionCheckUtils;
import com.fr.env.TestConnectionResult; import com.fr.env.TestConnectionResult;
import com.fr.event.Event; import com.fr.event.Event;
import com.fr.event.EventDispatcher; import com.fr.event.EventDispatcher;

Loading…
Cancel
Save