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.versioncheck.VersionCheckUtils;
import com.fr.env.EnvListPane;
import com.fr.env.HelpLink;
import com.fr.env.handler.RemoteDesignExceptionHandler;
import com.fr.exit.DesignerExiter;
import com.fr.general.GeneralUtils;
@ -139,6 +140,7 @@ public class EnvChangeEntrance {
pluginErrorRemind();
} catch (Exception exception) {
// 失败的处理
HelpLink.setConnectionInfo(connectionInfo);
RemoteDesignExceptionHandler.getInstance().handleInSwitch(exception, selectedEnv);
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 String TAG_A_START = "<a>";
private static final String TAG_A_END = "</a>";
private static final double SCALE = 1.2;
private final Dimension dimension = new Dimension(300, 180);
@ -99,6 +100,7 @@ public class UIDetailErrorLinkDialog extends UIDialog {
this.getContentPane().add(actionPane, BorderLayout.SOUTH);
this.setSize(dimension);
this.setResizable(false);
this.setModal(true);
GUICoreUtils.centerWindow(this);
}
@ -139,11 +141,21 @@ public class UIDetailErrorLinkDialog extends UIDialog {
UILabel solutionLabel = new UILabel(solution);
panel.add(solutionLabel, BorderLayout.CENTER);
}
dimension.width = Math.max(maxWidth, GraphHelper.getWidth(solution, DesignUtils.getDefaultGUIFont()));
dimension.width = getMaxDimensionWidth(maxWidth, solution);
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
public void checkValid() throws Exception {
// 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.LocaleMark;
import com.fr.locale.InterProviderFactory;
import com.fr.workspace.connect.WorkspaceConnectionInfo;
import java.util.HashMap;
import java.util.Map;
/**
* 错误提示中的跳转链接管理
*
* @author hades
* @version 10.0
* Created by hades on 2021/8/9
*/
public class HelpLink {
private static WorkspaceConnectionInfo connectionInfo;
public static String getLink(String solution) {
Map<String, String> map = new HashMap<>();
String currentName = DesignerEnvManager.getEnvManager().getCurEnvName();
DesignerWorkspaceInfo workspaceInfo = DesignerEnvManager.getEnvManager().getWorkspaceInfo(currentName);
LocaleMark<String> linkMark = LocaleCenter.getMark(RemoteDesignLocaleMark.class);
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_Connection_Unknown_Error_Solution"), link);
map.put(InterProviderFactory.getProvider().getLocText("Fine-Core_Remote_Design_NetWork_Connection_Error_Solution"), link);
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) {
dialog.dispose();
HelpLink.setConnectionInfo(connection);
RemoteDesignExceptionHandler.getInstance().handleInTest(e);
}
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;
/**
* 取消测试连接时的处理器
*
* @author hades
* @version 10.0
* 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())).
setThrowable(e).build();
detailErrorLinkDialog.setVisible(true);
HelpLink.setConnectionInfo(null);
}
});
}

Loading…
Cancel
Save