|
|
@ -1,9 +1,6 @@ |
|
|
|
package com.fr.design; |
|
|
|
package com.fr.design; |
|
|
|
|
|
|
|
|
|
|
|
import com.fr.common.report.ReportState; |
|
|
|
import com.fr.common.report.ReportState; |
|
|
|
import com.fr.design.env.processor.RemoteDesignerWorkspaceInfoProcessor; |
|
|
|
|
|
|
|
import com.fr.design.mainframe.manager.clip.TemplateTreeClipboard; |
|
|
|
|
|
|
|
import com.fr.design.plugin.remind.PluginErrorDesignReminder; |
|
|
|
|
|
|
|
import com.fr.design.data.DesignTableDataManager; |
|
|
|
import com.fr.design.data.DesignTableDataManager; |
|
|
|
import com.fr.design.dialog.BasicDialog; |
|
|
|
import com.fr.design.dialog.BasicDialog; |
|
|
|
import com.fr.design.dialog.DialogActionAdapter; |
|
|
|
import com.fr.design.dialog.DialogActionAdapter; |
|
|
@ -14,13 +11,16 @@ import com.fr.design.env.DesignerWorkspaceInfoContext; |
|
|
|
import com.fr.design.env.DesignerWorkspaceType; |
|
|
|
import com.fr.design.env.DesignerWorkspaceType; |
|
|
|
import com.fr.design.env.RemoteDesignerWorkspaceInfo; |
|
|
|
import com.fr.design.env.RemoteDesignerWorkspaceInfo; |
|
|
|
import com.fr.design.env.RemoteWorkspace; |
|
|
|
import com.fr.design.env.RemoteWorkspace; |
|
|
|
|
|
|
|
import com.fr.design.env.processor.RemoteDesignerWorkspaceInfoProcessor; |
|
|
|
import com.fr.design.file.HistoryTemplateListCache; |
|
|
|
import com.fr.design.file.HistoryTemplateListCache; |
|
|
|
import com.fr.design.file.SaveSomeTemplatePane; |
|
|
|
import com.fr.design.file.SaveSomeTemplatePane; |
|
|
|
import com.fr.design.file.TemplateTreePane; |
|
|
|
import com.fr.design.file.TemplateTreePane; |
|
|
|
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.design.mainframe.JTemplate; |
|
|
|
import com.fr.design.mainframe.JTemplate; |
|
|
|
|
|
|
|
import com.fr.design.mainframe.manager.clip.TemplateTreeClipboard; |
|
|
|
import com.fr.design.notification.NotificationCenter; |
|
|
|
import com.fr.design.notification.NotificationCenter; |
|
|
|
|
|
|
|
import com.fr.design.plugin.remind.PluginErrorDesignReminder; |
|
|
|
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; |
|
|
@ -31,6 +31,7 @@ import com.fr.invoke.Reflect; |
|
|
|
import com.fr.json.JSONArray; |
|
|
|
import com.fr.json.JSONArray; |
|
|
|
import com.fr.locale.InterProviderFactory; |
|
|
|
import com.fr.locale.InterProviderFactory; |
|
|
|
import com.fr.log.FineLoggerFactory; |
|
|
|
import com.fr.log.FineLoggerFactory; |
|
|
|
|
|
|
|
import com.fr.performance.profile.PerformancePoint; |
|
|
|
import com.fr.process.ProcessEventPipe; |
|
|
|
import com.fr.process.ProcessEventPipe; |
|
|
|
import com.fr.process.engine.core.CarryMessageEvent; |
|
|
|
import com.fr.process.engine.core.CarryMessageEvent; |
|
|
|
import com.fr.process.engine.core.FineProcessContext; |
|
|
|
import com.fr.process.engine.core.FineProcessContext; |
|
|
@ -41,12 +42,14 @@ import com.fr.start.server.ServerTray; |
|
|
|
import com.fr.workspace.WorkContext; |
|
|
|
import com.fr.workspace.WorkContext; |
|
|
|
import com.fr.workspace.WorkContextCallback; |
|
|
|
import com.fr.workspace.WorkContextCallback; |
|
|
|
import com.fr.workspace.Workspace; |
|
|
|
import com.fr.workspace.Workspace; |
|
|
|
|
|
|
|
import com.fr.workspace.WorkspaceSwitchProcess; |
|
|
|
import com.fr.workspace.base.WorkspaceAPI; |
|
|
|
import com.fr.workspace.base.WorkspaceAPI; |
|
|
|
import com.fr.workspace.connect.WorkspaceConnectionInfo; |
|
|
|
import com.fr.workspace.connect.WorkspaceConnectionInfo; |
|
|
|
import com.fr.workspace.engine.base.FineObjectPool; |
|
|
|
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 static javax.swing.JOptionPane.QUESTION_MESSAGE; |
|
|
|
|
|
|
|
|
|
|
|
import javax.swing.JOptionPane; |
|
|
|
import javax.swing.JOptionPane; |
|
|
|
import javax.swing.SwingUtilities; |
|
|
|
import javax.swing.SwingUtilities; |
|
|
@ -58,12 +61,11 @@ import java.util.ArrayList; |
|
|
|
import java.util.Calendar; |
|
|
|
import java.util.Calendar; |
|
|
|
import java.util.Date; |
|
|
|
import java.util.Date; |
|
|
|
import java.util.HashMap; |
|
|
|
import java.util.HashMap; |
|
|
|
|
|
|
|
import java.util.HashSet; |
|
|
|
import java.util.Iterator; |
|
|
|
import java.util.Iterator; |
|
|
|
import java.util.List; |
|
|
|
import java.util.List; |
|
|
|
|
|
|
|
import java.util.Optional; |
|
|
|
import java.util.Set; |
|
|
|
import java.util.Set; |
|
|
|
import java.util.HashSet; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
import static javax.swing.JOptionPane.QUESTION_MESSAGE; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public class EnvChangeEntrance { |
|
|
|
public class EnvChangeEntrance { |
|
|
|
private static final String BRANCH_TAG = "#"; |
|
|
|
private static final String BRANCH_TAG = "#"; |
|
|
@ -132,6 +134,9 @@ public class EnvChangeEntrance { |
|
|
|
* @return 是否成功 |
|
|
|
* @return 是否成功 |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
private boolean switch2Env(final String envName, PopTipStrategy strategy) { |
|
|
|
private boolean switch2Env(final String envName, PopTipStrategy strategy) { |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
PerformancePoint performancePoint = PerformancePoint.create(); |
|
|
|
|
|
|
|
|
|
|
|
DesignerEnvManager envManager = DesignerEnvManager.getEnvManager(); |
|
|
|
DesignerEnvManager envManager = DesignerEnvManager.getEnvManager(); |
|
|
|
DesignerWorkspaceInfo selectedEnv = customUserName(envManager.getWorkspaceInfo(envName)); |
|
|
|
DesignerWorkspaceInfo selectedEnv = customUserName(envManager.getWorkspaceInfo(envName)); |
|
|
|
DesignerWorkspaceInfoContext.setWorkspaceInfo(selectedEnv); |
|
|
|
DesignerWorkspaceInfoContext.setWorkspaceInfo(selectedEnv); |
|
|
@ -165,6 +170,8 @@ public class EnvChangeEntrance { |
|
|
|
} catch (Exception exception) { |
|
|
|
} catch (Exception exception) { |
|
|
|
// 失败的处理
|
|
|
|
// 失败的处理
|
|
|
|
WorkspaceExceptionHandler.getInstance().handleInSwitch(exception, selectedEnv); |
|
|
|
WorkspaceExceptionHandler.getInstance().handleInSwitch(exception, selectedEnv); |
|
|
|
|
|
|
|
// 记录切换耗时
|
|
|
|
|
|
|
|
recordSwitchElapsed(performancePoint); |
|
|
|
return false; |
|
|
|
return false; |
|
|
|
} |
|
|
|
} |
|
|
|
TemplateTreePane.getInstance().refreshDockingView(); |
|
|
|
TemplateTreePane.getInstance().refreshDockingView(); |
|
|
@ -175,9 +182,20 @@ public class EnvChangeEntrance { |
|
|
|
NotificationCenter.getInstance().clearAllNotifications(); |
|
|
|
NotificationCenter.getInstance().clearAllNotifications(); |
|
|
|
//切换环境后,清空粘贴板里面的内容
|
|
|
|
//切换环境后,清空粘贴板里面的内容
|
|
|
|
TemplateTreeClipboard.getInstance().reset(); |
|
|
|
TemplateTreeClipboard.getInstance().reset(); |
|
|
|
|
|
|
|
// 记录切换耗时
|
|
|
|
|
|
|
|
recordSwitchElapsed(performancePoint); |
|
|
|
return true; |
|
|
|
return true; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private static void recordSwitchElapsed(PerformancePoint performancePoint) { |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
performancePoint.end(elapsed -> { |
|
|
|
|
|
|
|
WorkspaceSwitchProcess process = WorkContext.getSwitcher().getProgress(); |
|
|
|
|
|
|
|
Optional.ofNullable(process) |
|
|
|
|
|
|
|
.ifPresent((e) -> e.recordSwitchElapsed(elapsed)); |
|
|
|
|
|
|
|
}); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
|
* 切换到其他环境 |
|
|
|
* 切换到其他环境 |
|
|
|
* |
|
|
|
* |
|
|
|