Browse Source

REPORT-55795 【10.0.19】报错规范——设计器远程设计连接部分

feature/10.0
hades 3 years ago
parent
commit
182b9164dc
  1. 2
      designer-base/src/main/java/com/fr/design/EnvChangeEntrance.java
  2. 14
      designer-base/src/main/java/com/fr/design/dialog/UIDetailErrorLinkDialog.java
  3. 12
      designer-base/src/main/java/com/fr/env/HelpLink.java
  4. 1
      designer-base/src/main/java/com/fr/env/RemoteEnvPane.java
  5. 2
      designer-base/src/main/java/com/fr/env/handler/impl/CancelHandler.java
  6. 1
      designer-base/src/main/java/com/fr/env/handler/impl/CommonHandler.java

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

@ -20,6 +20,7 @@ import com.fr.design.notification.NotificationCenter;
import com.fr.design.utils.DesignUtils; import com.fr.design.utils.DesignUtils;
import com.fr.design.versioncheck.VersionCheckUtils; import com.fr.design.versioncheck.VersionCheckUtils;
import com.fr.env.EnvListPane; import com.fr.env.EnvListPane;
import com.fr.env.HelpLink;
import com.fr.env.handler.RemoteDesignExceptionHandler; import com.fr.env.handler.RemoteDesignExceptionHandler;
import com.fr.exit.DesignerExiter; import com.fr.exit.DesignerExiter;
import com.fr.general.GeneralUtils; import com.fr.general.GeneralUtils;
@ -139,6 +140,7 @@ public class EnvChangeEntrance {
pluginErrorRemind(); pluginErrorRemind();
} catch (Exception exception) { } catch (Exception exception) {
// 失败的处理 // 失败的处理
HelpLink.setConnectionInfo(connectionInfo);
RemoteDesignExceptionHandler.getInstance().handleInSwitch(exception, selectedEnv); RemoteDesignExceptionHandler.getInstance().handleInSwitch(exception, selectedEnv);
return false; return false;
} }

14
designer-base/src/main/java/com/fr/design/dialog/UIDetailErrorLinkDialog.java

@ -44,6 +44,7 @@ public class UIDetailErrorLinkDialog extends UIDialog {
private static final int GAP_10 = 10; private static final int GAP_10 = 10;
private static final String TAG_A_START = "<a>"; private static final String TAG_A_START = "<a>";
private static final String TAG_A_END = "</a>"; private static final String TAG_A_END = "</a>";
private static final double SCALE = 1.2;
private final Dimension dimension = new Dimension(300, 180); private final Dimension dimension = new Dimension(300, 180);
@ -99,6 +100,7 @@ public class UIDetailErrorLinkDialog extends UIDialog {
this.getContentPane().add(actionPane, BorderLayout.SOUTH); this.getContentPane().add(actionPane, BorderLayout.SOUTH);
this.setSize(dimension); this.setSize(dimension);
this.setResizable(false); this.setResizable(false);
this.setModal(true);
GUICoreUtils.centerWindow(this); GUICoreUtils.centerWindow(this);
} }
@ -139,11 +141,21 @@ public class UIDetailErrorLinkDialog extends UIDialog {
UILabel solutionLabel = new UILabel(solution); UILabel solutionLabel = new UILabel(solution);
panel.add(solutionLabel, BorderLayout.CENTER); panel.add(solutionLabel, BorderLayout.CENTER);
} }
dimension.width = Math.max(maxWidth, GraphHelper.getWidth(solution, DesignUtils.getDefaultGUIFont())); dimension.width = getMaxDimensionWidth(maxWidth, solution);
return panel; return panel;
} }
private int getMaxDimensionWidth(int width, String solution) {
int maxWidth = GraphHelper.getWidth(solution, DesignUtils.getDefaultGUIFont());
if (maxWidth >= width) {
maxWidth = (int) (SCALE * maxWidth);
} else {
maxWidth = width;
}
return maxWidth;
}
@Override @Override
public void checkValid() throws Exception { public void checkValid() throws Exception {
// do nothing // do nothing

12
designer-base/src/main/java/com/fr/env/HelpLink.java vendored

@ -5,28 +5,36 @@ import com.fr.design.env.DesignerWorkspaceInfo;
import com.fr.general.locale.LocaleCenter; import com.fr.general.locale.LocaleCenter;
import com.fr.general.locale.LocaleMark; import com.fr.general.locale.LocaleMark;
import com.fr.locale.InterProviderFactory; import com.fr.locale.InterProviderFactory;
import com.fr.workspace.connect.WorkspaceConnectionInfo;
import java.util.HashMap; import java.util.HashMap;
import java.util.Map; import java.util.Map;
/** /**
* 错误提示中的跳转链接管理
*
* @author hades * @author hades
* @version 10.0 * @version 10.0
* Created by hades on 2021/8/9 * Created by hades on 2021/8/9
*/ */
public class HelpLink { public class HelpLink {
private static WorkspaceConnectionInfo connectionInfo;
public static String getLink(String solution) { public static String getLink(String solution) {
Map<String, String> map = new HashMap<>(); Map<String, String> map = new HashMap<>();
String currentName = DesignerEnvManager.getEnvManager().getCurEnvName(); String currentName = DesignerEnvManager.getEnvManager().getCurEnvName();
DesignerWorkspaceInfo workspaceInfo = DesignerEnvManager.getEnvManager().getWorkspaceInfo(currentName); DesignerWorkspaceInfo workspaceInfo = DesignerEnvManager.getEnvManager().getWorkspaceInfo(currentName);
LocaleMark<String> linkMark = LocaleCenter.getMark(RemoteDesignLocaleMark.class); LocaleMark<String> linkMark = LocaleCenter.getMark(RemoteDesignLocaleMark.class);
String link = linkMark.getValue(); String link = linkMark.getValue();
map.put(InterProviderFactory.getProvider().getLocText("Fine-Core_Remote_Design_Change_PassWord"), workspaceInfo.getConnection().getUrl() + RemoteWorkspaceURL.SYSTEM_LOGIN_PATH); String url = connectionInfo == null ? workspaceInfo.getConnection().getUrl() : connectionInfo.getUrl();
map.put(InterProviderFactory.getProvider().getLocText("Fine-Core_Remote_Design_Change_PassWord"), url + RemoteWorkspaceURL.SYSTEM_LOGIN_PATH);
map.put(InterProviderFactory.getProvider().getLocText("Fine-Core_Remote_Design_Cert_Error_Solution"), link); map.put(InterProviderFactory.getProvider().getLocText("Fine-Core_Remote_Design_Cert_Error_Solution"), link);
map.put(InterProviderFactory.getProvider().getLocText("Fine-Core_Remote_Design_Connection_Unknown_Error_Solution"), link); map.put(InterProviderFactory.getProvider().getLocText("Fine-Core_Remote_Design_Connection_Unknown_Error_Solution"), link);
map.put(InterProviderFactory.getProvider().getLocText("Fine-Core_Remote_Design_NetWork_Connection_Error_Solution"), link); map.put(InterProviderFactory.getProvider().getLocText("Fine-Core_Remote_Design_NetWork_Connection_Error_Solution"), link);
return map.get(solution); return map.get(solution);
} }
public static void setConnectionInfo(WorkspaceConnectionInfo connectionInfo) {
HelpLink.connectionInfo = connectionInfo;
}
} }

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

@ -596,6 +596,7 @@ public class RemoteEnvPane extends BasicBeanPane<RemoteDesignerWorkspaceInfo> {
} }
} catch (Exception e) { } catch (Exception e) {
dialog.dispose(); dialog.dispose();
HelpLink.setConnectionInfo(connection);
RemoteDesignExceptionHandler.getInstance().handleInTest(e); RemoteDesignExceptionHandler.getInstance().handleInTest(e);
} }
dialogDownPane.remove(cancelButton); dialogDownPane.remove(cancelButton);

2
designer-base/src/main/java/com/fr/env/handler/impl/CancelHandler.java vendored

@ -5,6 +5,8 @@ import com.fr.env.handler.ResultWrapper;
import java.util.concurrent.CancellationException; import java.util.concurrent.CancellationException;
/** /**
* 取消测试连接时的处理器
*
* @author hades * @author hades
* @version 10.0 * @version 10.0
* Created by hades on 2021/8/5 * Created by hades on 2021/8/5

1
designer-base/src/main/java/com/fr/env/handler/impl/CommonHandler.java vendored

@ -40,6 +40,7 @@ public class CommonHandler implements Handler<Throwable, ResultWrapper> {
setLink(HelpLink.getLink(exceptionDescriptor.solution())). setLink(HelpLink.getLink(exceptionDescriptor.solution())).
setThrowable(e).build(); setThrowable(e).build();
detailErrorLinkDialog.setVisible(true); detailErrorLinkDialog.setVisible(true);
HelpLink.setConnectionInfo(null);
} }
}); });
} }

Loading…
Cancel
Save