From 4c93226a2408d2d052965ddfa2dc73383424d9f7 Mon Sep 17 00:00:00 2001 From: Yvan Date: Thu, 26 May 2022 18:33:37 +0800 Subject: [PATCH] =?UTF-8?q?REPORT-70481=20=E8=BF=9C=E7=A8=8B=E8=AE=BE?= =?UTF-8?q?=E8=AE=A1=E5=88=87=E6=8D=A2=E6=A0=A1=E9=AA=8C=E6=9C=BA=E5=88=B6?= =?UTF-8?q?=E4=BC=98=E5=8C=96=201.=20=E5=A2=9E=E5=8A=A0=E5=88=87=E6=8D=A2?= =?UTF-8?q?=E5=B7=A5=E4=BD=9C=E7=9B=AE=E5=BD=95=E5=89=8D=EF=BC=8C=E5=BC=B9?= =?UTF-8?q?=E7=AA=97=E6=8F=90=E7=A4=BA=E7=94=A8=E6=88=B7=E4=BF=9D=E5=AD=98?= =?UTF-8?q?=E7=9A=84=E9=80=BB=E8=BE=91=202.=20=E5=A2=9E=E5=8A=A0=E6=B3=A8?= =?UTF-8?q?=E9=87=8A?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/java/com/fr/design/EnvChangeEntrance.java | 3 +++ .../main/java/com/fr/design/actions/file/SwitchExistEnv.java | 3 +++ .../src/main/java/com/fr/design/mainframe/JTemplate.java | 2 +- 3 files changed, 7 insertions(+), 1 deletion(-) diff --git a/designer-base/src/main/java/com/fr/design/EnvChangeEntrance.java b/designer-base/src/main/java/com/fr/design/EnvChangeEntrance.java index cd9c835f39..60554ef7dc 100644 --- a/designer-base/src/main/java/com/fr/design/EnvChangeEntrance.java +++ b/designer-base/src/main/java/com/fr/design/EnvChangeEntrance.java @@ -13,6 +13,7 @@ import com.fr.design.env.DesignerWorkspaceType; import com.fr.design.env.RemoteDesignerWorkspaceInfo; import com.fr.design.env.RemoteWorkspace; import com.fr.design.file.HistoryTemplateListCache; +import com.fr.design.file.SaveSomeTemplatePane; import com.fr.design.file.TemplateTreePane; import com.fr.design.i18n.Toolkit; import com.fr.design.mainframe.DesignerContext; @@ -82,6 +83,8 @@ public class EnvChangeEntrance { private boolean envListOkAction(EnvListPane envListPane, PopTipStrategy strategy) { final String selectedName = envListPane.updateEnvManager(); + SaveSomeTemplatePane saveSomeTemplatePane = new SaveSomeTemplatePane(true, SwingUtilities.getWindowAncestor(envListPane)); + saveSomeTemplatePane.showSavePane(); return switch2Env(selectedName, strategy); } diff --git a/designer-base/src/main/java/com/fr/design/actions/file/SwitchExistEnv.java b/designer-base/src/main/java/com/fr/design/actions/file/SwitchExistEnv.java index c59a92b975..b47d5ef1ec 100644 --- a/designer-base/src/main/java/com/fr/design/actions/file/SwitchExistEnv.java +++ b/designer-base/src/main/java/com/fr/design/actions/file/SwitchExistEnv.java @@ -5,6 +5,7 @@ import com.fr.design.EnvChangeEntrance; import com.fr.design.actions.UpdateAction; import com.fr.design.env.DesignerWorkspaceInfo; import com.fr.design.file.HistoryTemplateListCache; +import com.fr.design.file.SaveSomeTemplatePane; import com.fr.design.mainframe.JTemplate; import com.fr.design.menu.KeySetUtils; import com.fr.design.menu.MenuDef; @@ -66,6 +67,8 @@ public class SwitchExistEnv extends MenuDef { // 打开配置目录面板 EnvChangeEntrance.getInstance().chooseEnv(envName); } else { + SaveSomeTemplatePane saveSomeTemplatePane = new SaveSomeTemplatePane(true); + saveSomeTemplatePane.showSavePane(); EnvChangeEntrance.getInstance().switch2Env(envName); } } diff --git a/designer-base/src/main/java/com/fr/design/mainframe/JTemplate.java b/designer-base/src/main/java/com/fr/design/mainframe/JTemplate.java index ff5a2ed50f..d11b8bf1d5 100644 --- a/designer-base/src/main/java/com/fr/design/mainframe/JTemplate.java +++ b/designer-base/src/main/java/com/fr/design/mainframe/JTemplate.java @@ -519,7 +519,7 @@ public abstract class JTemplate> * @param file */ public void refreshResourceAndEditingFILE(FILE file) { - + // 这里替换EditingFILE是为了在切换工作目录后,将模板文件对象设置成环境无关文件对象 this.editingFILE = file instanceof StashedFILE ? ((StashedFILE) file).getInsideFILE() : file; refreshResource(file); }