From b0710669bce8f6e60476c2512e9749f6045d3a7e Mon Sep 17 00:00:00 2001 From: kerry Date: Thu, 5 Nov 2020 16:20:18 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BB=A3=E7=A0=81=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/fr/design/utils/DesignUtils.java | 18 +++--------------- .../module/DesignerWorkspaceProvider.java | 2 ++ 2 files changed, 5 insertions(+), 15 deletions(-) diff --git a/designer-base/src/main/java/com/fr/design/utils/DesignUtils.java b/designer-base/src/main/java/com/fr/design/utils/DesignUtils.java index 59f4048f58..49dbb03c3a 100644 --- a/designer-base/src/main/java/com/fr/design/utils/DesignUtils.java +++ b/designer-base/src/main/java/com/fr/design/utils/DesignUtils.java @@ -5,17 +5,12 @@ import com.fr.base.ServerConfig; import com.fr.concurrent.NamedThreadFactory; import com.fr.design.DesignerEnvManager; import com.fr.design.ExtraDesignClassManager; -import com.fr.design.constants.DesignerLaunchStatus; import com.fr.design.dialog.FineJOptionPane; import com.fr.design.env.DesignerWorkspaceInfo; import com.fr.design.fun.DesignerEnvProcessor; import com.fr.design.gui.UILookAndFeel; import com.fr.design.i18n.Toolkit; import com.fr.design.mainframe.DesignerContext; -import com.fr.event.Event; -import com.fr.event.EventDispatcher; -import com.fr.event.Listener; -import com.fr.event.Null; import com.fr.exit.DesignerExiter; import com.fr.file.FileFILE; import com.fr.general.ComparatorUtils; @@ -66,16 +61,6 @@ import java.util.concurrent.TimeoutException; public class DesignUtils { private static int port = DesignerPort.getInstance().getMessagePort(); - - static { - EventDispatcher.listen(DesignerLaunchStatus.WORKSPACE_INIT_COMPLETE, new Listener() { - @Override - public void on(Event event, Null aNull) { - checkDesignerEnvMatch(); - } - }); - } - private static boolean started = false; /** @@ -444,6 +429,9 @@ public class DesignUtils { return true; } + /** + * check下设计器jar包版本和当前envjar包版本是否匹配,设计器启动后和环境切换成功后调用 + */ public static void checkDesignerEnvMatch(){ if (WorkContext.getCurrent().isLocal()){ designerEnvMatch = true; diff --git a/designer-realize/src/main/java/com/fr/start/module/DesignerWorkspaceProvider.java b/designer-realize/src/main/java/com/fr/start/module/DesignerWorkspaceProvider.java index 43ae6ddcdf..ddfaafacd7 100644 --- a/designer-realize/src/main/java/com/fr/start/module/DesignerWorkspaceProvider.java +++ b/designer-realize/src/main/java/com/fr/start/module/DesignerWorkspaceProvider.java @@ -6,6 +6,7 @@ import com.fr.design.constants.DesignerLaunchStatus; import com.fr.design.env.DesignerWorkspaceGenerator; import com.fr.design.env.DesignerWorkspaceInfo; import com.fr.design.env.LocalDesignerWorkspaceInfo; +import com.fr.design.utils.DesignUtils; import com.fr.event.Event; import com.fr.event.EventDispatcher; import com.fr.event.Listener; @@ -59,6 +60,7 @@ public class DesignerWorkspaceProvider extends Activator { EnvChangeEntrance.getInstance().dealEvnExceptionWhenStartDesigner(); } else { WorkContext.switchTo(workspace); + DesignUtils.checkDesignerEnvMatch(); //在设计器完全启动完成后,对初始环境进行一次服务检测,对主要功能无影响,异常仅做日志提示即可 final DesignerWorkspaceInfo selectEnv = workspaceInfo; EventDispatcher.listen(DesignerLaunchStatus.STARTUP_COMPLETE, new Listener() {