Browse Source

Merge pull request #5052 in DESIGN/design from final/10.0 to release/10.0

* commit 'ad0ffecf5f9c05bc9f9990b0441afa9ac23688f2':
  REPORT-55509 & REPORT-54844 按钮灰化和弹框关闭问题
  REPORT-55509 & REPORT-54844 按钮灰化和弹框关闭问题
zheng-1641779399395
superman 3 years ago
parent
commit
07db171833
  1. 30
      designer-base/src/main/java/com/fr/design/versioncheck/VersionCheckUtils.java
  2. 26
      designer-base/src/main/java/com/fr/env/CheckServiceDialog.java
  3. 8
      designer-base/src/main/java/com/fr/env/SyncFailedPluginsDialog.java

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

@ -26,6 +26,8 @@ import com.fr.plugin.manage.control.PluginTaskCallback;
import com.fr.plugin.manage.control.PluginTaskResult; import com.fr.plugin.manage.control.PluginTaskResult;
import com.fr.plugin.manage.control.ProgressCallback; import com.fr.plugin.manage.control.ProgressCallback;
import com.fr.report.ReportHelper; import com.fr.report.ReportHelper;
import com.fr.rpc.ExceptionHandler;
import com.fr.rpc.RPCInvokerExceptionInfo;
import com.fr.rpc.Result; import com.fr.rpc.Result;
import com.fr.stable.StringUtils; import com.fr.stable.StringUtils;
import com.fr.workspace.WorkContext; import com.fr.workspace.WorkContext;
@ -35,6 +37,7 @@ 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 com.fr.workspace.server.check.VersionInfoOperator;
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;
@ -160,15 +163,22 @@ public class VersionCheckUtils {
} }
public static String getRemoteBranch(DesignerWorkspaceInfo selectedEnv) { public static String getRemoteBranch(DesignerWorkspaceInfo selectedEnv) {
String remoteBranch = StringUtils.EMPTY; String remoteBranch;
WorkspaceConnectionInfo connectionInfo = selectedEnv.getConnection(); remoteBranch = WorkContext.getCurrent().get(VersionInfoOperator.class, new ExceptionHandler<String>() {
try { @Override
remoteBranch = new FunctionalHttpRequest(connectionInfo).getServerBranch(); public String callHandler(RPCInvokerExceptionInfo exceptionInfo) {
} catch (WorkspaceConnectionException e) { WorkspaceConnectionInfo connectionInfo = selectedEnv.getConnection();
remoteBranch = Toolkit.i18nText("Fine-Design_Basic_Remote_Design_Branch_Is_Old") + formatBranch(GeneralUtils.readFullBuildNO()); String remoteBranch = StringUtils.EMPTY;
} catch (Exception e) { try {
FineLoggerFactory.getLogger().error(e.getMessage(), e); remoteBranch = new FunctionalHttpRequest(connectionInfo).getServerBranch();
} } catch (WorkspaceConnectionException e) {
remoteBranch = Toolkit.i18nText("Fine-Design_Basic_Remote_Design_Branch_Is_Old") + formatBranch(GeneralUtils.readFullBuildNO());
} catch (Exception e) {
FineLoggerFactory.getLogger().error(e.getMessage(), e);
}
return remoteBranch;
}
}).getFullBuildNO();
return remoteBranch; return remoteBranch;
} }
@ -252,7 +262,7 @@ public class VersionCheckUtils {
Map<String, String> pluginsNameMap = ReportHelper.getPluginNameMap(); Map<String, String> pluginsNameMap = ReportHelper.getPluginNameMap();
for (int i = 0; i < remotePlugins.size(); i++) { for (int i = 0; i < remotePlugins.size(); i++) {
remotePlugin = remotePlugins.getJSONObject(i); remotePlugin = remotePlugins.getJSONObject(i);
if (ComparatorUtils.equals(remotePlugin.getString("running"), "false")) { if (ComparatorUtils.equals(remotePlugin.getString("running"), "false") || (remotePlugin.containsKey("sync") && !remotePlugin.getBoolean("sync"))) {
continue; continue;
} }
String remotePluginID = remotePlugin.getString(ID); String remotePluginID = remotePlugin.getString(ID);

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

@ -36,6 +36,8 @@ import java.awt.Component;
import java.awt.event.MouseAdapter; import java.awt.event.MouseAdapter;
import java.awt.event.MouseEvent; import java.awt.event.MouseEvent;
import java.awt.event.MouseListener; import java.awt.event.MouseListener;
import java.awt.event.WindowAdapter;
import java.awt.event.WindowEvent;
import java.io.File; import java.io.File;
import java.util.List; import java.util.List;
import javax.swing.BorderFactory; import javax.swing.BorderFactory;
@ -172,7 +174,7 @@ public class CheckServiceDialog extends JDialog implements ActionListener {
ignoreButton.addActionListener(this); ignoreButton.addActionListener(this);
syncButton = new UIButton(Toolkit.i18nText("Fine-Design_Basic_Sync_To_Local")); syncButton = new UIButton(Toolkit.i18nText("Fine-Design_Basic_Sync_To_Local"));
syncButton.setToolTipText(Toolkit.i18nText("Fine-Design_Basic_Sync_To_Local_Tip")); syncButton.setToolTipText(Toolkit.i18nText("Fine-Design_Basic_Sync_To_Local_Tip"));
syncButton.addMouseListener(syncButtonClickListener); syncButton.addActionListener(syncButtonActionListener);
if(jarConsistency && differentPlugins.isEmpty()){ if(jarConsistency && differentPlugins.isEmpty()){
syncButton.setEnabled(false); syncButton.setEnabled(false);
} }
@ -186,8 +188,10 @@ public class CheckServiceDialog extends JDialog implements ActionListener {
buttonPanel.add(progressBar, BorderLayout.CENTER); buttonPanel.add(progressBar, BorderLayout.CENTER);
buttonPanel.add(syncButton, BorderLayout.EAST); buttonPanel.add(syncButton, BorderLayout.EAST);
} else { } else {
UILabel adviceLabel = new UILabel(Toolkit.i18nText("Fine-Design_Basic_Sync_Suggestion")); if (!(jarConsistency && differentPlugins.isEmpty())) {
centerPanel.add(adviceLabel, BorderLayout.SOUTH); UILabel adviceLabel = new UILabel(Toolkit.i18nText("Fine-Design_Basic_Sync_Suggestion"));
centerPanel.add(adviceLabel, BorderLayout.SOUTH);
}
UIButton okButton = new UIButton(Toolkit.i18nText("Fine-Design_Basic_Remote_Design_Button_Confirm")); UIButton okButton = new UIButton(Toolkit.i18nText("Fine-Design_Basic_Remote_Design_Button_Confirm"));
okButton.addActionListener(this); okButton.addActionListener(this);
buttonPanel.add(okButton, BorderLayout.EAST); buttonPanel.add(okButton, BorderLayout.EAST);
@ -198,6 +202,12 @@ public class CheckServiceDialog extends JDialog implements ActionListener {
this.add(centerPanel, BorderLayout.CENTER); this.add(centerPanel, BorderLayout.CENTER);
this.add(buttonPanel, BorderLayout.SOUTH); this.add(buttonPanel, BorderLayout.SOUTH);
this.setSize(new Dimension(GeneralContext.getLocale().equals(Locale.US) ? 750 : 600, 500)); this.setSize(new Dimension(GeneralContext.getLocale().equals(Locale.US) ? 750 : 600, 500));
this.addWindowListener(new WindowAdapter() {
@Override
public void windowClosing(WindowEvent e) {
close();
}
});
GUICoreUtils.centerWindow(this); GUICoreUtils.centerWindow(this);
} }
@ -308,10 +318,10 @@ public class CheckServiceDialog extends JDialog implements ActionListener {
} }
}; };
private MouseListener syncButtonClickListener = new MouseAdapter() { private ActionListener syncButtonActionListener = new ActionListener() {
@Override @Override
public void mouseClicked(MouseEvent e) { public void actionPerformed(ActionEvent e) {
sync(); sync();
} }
}; };
@ -352,6 +362,9 @@ public class CheckServiceDialog extends JDialog implements ActionListener {
helper.restartForUpdate(frame); helper.restartForUpdate(frame);
} }
}.execute(); }.execute();
} else {
ignoreButton.setEnabled(true);
syncButton.setEnabled(true);
} }
} else { } else {
//到这边说明主jar是一致的,就只尝试同步插件 //到这边说明主jar是一致的,就只尝试同步插件
@ -389,7 +402,6 @@ public class CheckServiceDialog extends JDialog implements ActionListener {
} }
} }
private boolean deletePreviousPropertyFile() { private boolean deletePreviousPropertyFile() {
File moveFile = new File(RestartHelper.MOVE_FILE); File moveFile = new File(RestartHelper.MOVE_FILE);
File delFile = new File(RestartHelper.RECORD_FILE); File delFile = new File(RestartHelper.RECORD_FILE);

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

@ -21,6 +21,8 @@ import java.awt.Dimension;
import java.awt.event.MouseAdapter; import java.awt.event.MouseAdapter;
import java.awt.event.MouseEvent; import java.awt.event.MouseEvent;
import java.awt.event.MouseListener; import java.awt.event.MouseListener;
import java.awt.event.WindowAdapter;
import java.awt.event.WindowEvent;
import java.util.Locale; import java.util.Locale;
import javax.swing.BorderFactory; import javax.swing.BorderFactory;
import javax.swing.Icon; import javax.swing.Icon;
@ -96,6 +98,12 @@ public class SyncFailedPluginsDialog extends JDialog {
this.setResizable(false); this.setResizable(false);
this.add(body, BorderLayout.CENTER); this.add(body, BorderLayout.CENTER);
this.setSize(new Dimension(GeneralContext.getLocale().equals(Locale.US) ? 400 : 380, 225)); this.setSize(new Dimension(GeneralContext.getLocale().equals(Locale.US) ? 400 : 380, 225));
this.addWindowListener(new WindowAdapter() {
@Override
public void windowClosing(WindowEvent e) {
hideDialog();
}
});
GUICoreUtils.centerWindow(this); GUICoreUtils.centerWindow(this);
} }

Loading…
Cancel
Save