From c8d7663f3edad2755894bed798ead361bef3bd04 Mon Sep 17 00:00:00 2001 From: lucian Date: Wed, 10 Jun 2020 15:56:52 +0800 Subject: [PATCH] =?UTF-8?q?REPORT-33348=20=E5=88=87=E6=8D=A2=E8=BF=9C?= =?UTF-8?q?=E7=A8=8B=E4=B8=8D=E5=8B=BE=E9=80=89=E8=AE=B0=E4=BD=8F=E5=AF=86?= =?UTF-8?q?=E7=A0=81=EF=BC=8C=E5=AF=86=E7=A0=81=E6=B2=A1=E6=9C=89=E6=B8=85?= =?UTF-8?q?=E6=8E=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/fr/design/EnvChangeEntrance.java | 20 +++++-------------- 1 file changed, 5 insertions(+), 15 deletions(-) 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 687a3fea0..cfe0840af 100644 --- a/designer-base/src/main/java/com/fr/design/EnvChangeEntrance.java +++ b/designer-base/src/main/java/com/fr/design/EnvChangeEntrance.java @@ -19,7 +19,6 @@ import com.fr.design.utils.DesignUtils; import com.fr.env.CheckServiceDialog; import com.fr.env.EnvListPane; import com.fr.exit.DesignerExiter; -import com.fr.general.GeneralContext; import com.fr.general.GeneralUtils; import com.fr.invoke.Reflect; import com.fr.json.JSONArray; @@ -31,7 +30,6 @@ import com.fr.process.engine.core.CarryMessageEvent; import com.fr.process.engine.core.FineProcessContext; import com.fr.rpc.Result; import com.fr.stable.AssistUtils; -import com.fr.stable.EnvChangedListener; import com.fr.stable.StringUtils; import com.fr.start.server.ServerTray; import com.fr.workspace.WorkContext; @@ -64,8 +62,6 @@ import static javax.swing.JOptionPane.QUESTION_MESSAGE; public class EnvChangeEntrance { - private String currentEnvName = ""; - public static EnvChangeEntrance getInstance() { return HOLDER.singleton; } @@ -76,13 +72,7 @@ public class EnvChangeEntrance { private EnvChangeEntrance() { - currentEnvName = DesignerEnvManager.getEnvManager().getCurEnvName(); - GeneralContext.addEnvChangedListener(new EnvChangedListener() { - @Override - public void envChanged() { - currentEnvName = DesignerEnvManager.getEnvManager().getCurEnvName(); - } - }); + } private boolean envListOkAction(EnvListPane envListPane, PopTipStrategy strategy) { @@ -381,7 +371,7 @@ public class EnvChangeEntrance { * 出现对话框,选择使用的工作环境 */ public void chooseEnv() { - chooseEnv(currentEnvName); + chooseEnv(DesignerEnvManager.getEnvManager().getCurEnvName()); } public void chooseEnv(final String envName) { @@ -395,7 +385,7 @@ public class EnvChangeEntrance { public void doOk() { envListOkAction(envListPane, PopTipStrategy.LATER); // 切换完成后清理密码 - updateSelectEnv(envName); + updateSelectEnv(DesignerEnvManager.getEnvManager().getCurEnvName()); } @Override @@ -416,7 +406,7 @@ public class EnvChangeEntrance { eventPipe.fire(new CarryMessageEvent(ReportState.STOP.getValue())); } final EnvListPane envListPane = new EnvListPane(); - envListPane.populateEnvManager(currentEnvName); + envListPane.populateEnvManager(DesignerEnvManager.getEnvManager().getCurEnvName()); BasicDialog envListDialog = envListPane.showWindow(SwingUtilities.getWindowAncestor(DesignerContext.getDesignerFrame())); envListDialog.addDialogActionListener(new DialogActionAdapter() { @@ -426,7 +416,7 @@ public class EnvChangeEntrance { if (!envListOkAction(envListPane, PopTipStrategy.NOW)) { DesignerExiter.getInstance().execute(); } else { - updateSelectEnv(currentEnvName); + updateSelectEnv(DesignerEnvManager.getEnvManager().getCurEnvName()); } }