From 30c9c43eea872b302e4869bc2412c8d96d4b38e4 Mon Sep 17 00:00:00 2001 From: vito Date: Wed, 25 Sep 2019 18:53:16 +0800 Subject: [PATCH] =?UTF-8?q?REPORT-22308=20=E5=88=87=E6=8D=A2=E7=8E=AF?= =?UTF-8?q?=E5=A2=83=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../toolbar/UpdateActionManager.java | 1 + .../main/java/com/fr/start/BaseDesigner.java | 2 ++ .../java/com/fr/start/DesignerInitial.java | 1 + .../main/java/com/fr/start/SplashContext.java | 16 ++++++------ .../start/module/DesignerInitActivator.java | 25 +++++++++++++++++++ .../start/module/DesignerShowActivator.java | 2 +- .../com/fr/start/module/DesignerStartup.java | 2 +- 7 files changed, 40 insertions(+), 9 deletions(-) create mode 100644 designer-realize/src/main/java/com/fr/start/module/DesignerInitActivator.java diff --git a/designer-base/src/main/java/com/fr/design/mainframe/toolbar/UpdateActionManager.java b/designer-base/src/main/java/com/fr/design/mainframe/toolbar/UpdateActionManager.java index 5a1b9de6ce..2641a118ab 100644 --- a/designer-base/src/main/java/com/fr/design/mainframe/toolbar/UpdateActionManager.java +++ b/designer-base/src/main/java/com/fr/design/mainframe/toolbar/UpdateActionManager.java @@ -129,6 +129,7 @@ public class UpdateActionManager { EventDispatcher.listen(DesignerLaunchStatus.STARTUP_COMPLETE, new Listener() { @Override public void on(Event event, Null param) { + EventDispatcher.stopListen(this); afterStartup = true; for (Map.Entry cache : updateActionsIndexCache.entrySet()) { searchPool.execute(new IndexTask(cache.getKey(), cache.getValue())); diff --git a/designer-base/src/main/java/com/fr/start/BaseDesigner.java b/designer-base/src/main/java/com/fr/start/BaseDesigner.java index 37c668971d..833faaef70 100644 --- a/designer-base/src/main/java/com/fr/start/BaseDesigner.java +++ b/designer-base/src/main/java/com/fr/start/BaseDesigner.java @@ -61,6 +61,7 @@ public abstract class BaseDesigner extends ToolBarMenuDock { EventDispatcher.listen(DesignerLaunchStatus.DESIGNER_INIT_COMPLETE, new Listener() { @Override public void on(Event event, Null param) { + EventDispatcher.stopListen(this); UIUtil.invokeLaterIfNeeded(new Runnable() { @Override public void run() { @@ -75,6 +76,7 @@ public abstract class BaseDesigner extends ToolBarMenuDock { EventDispatcher.listen(DesignerLaunchStatus.STARTUP_COMPLETE, new Listener() { @Override public void on(Event event, Null param) { + EventDispatcher.stopListen(this); collectUserInformation(); } }); diff --git a/designer-realize/src/main/java/com/fr/start/DesignerInitial.java b/designer-realize/src/main/java/com/fr/start/DesignerInitial.java index dfbdb940dc..e6b9e4f464 100644 --- a/designer-realize/src/main/java/com/fr/start/DesignerInitial.java +++ b/designer-realize/src/main/java/com/fr/start/DesignerInitial.java @@ -37,6 +37,7 @@ public class DesignerInitial { EventDispatcher.listen(DesignerLaunchStatus.OPEN_LAST_FILE_COMPLETE, new Listener() { @Override public void on(Event event, Null param) { + EventDispatcher.stopListen(this); UIUtil.invokeLaterIfNeeded(new Runnable() { @Override public void run() { diff --git a/designer-realize/src/main/java/com/fr/start/SplashContext.java b/designer-realize/src/main/java/com/fr/start/SplashContext.java index b437846b95..d425d726ca 100644 --- a/designer-realize/src/main/java/com/fr/start/SplashContext.java +++ b/designer-realize/src/main/java/com/fr/start/SplashContext.java @@ -77,13 +77,15 @@ public class SplashContext { * 隐藏启动动画 */ public void hide() { - // 窗口关闭后取消定时获取模块信息的timer - scheduler.shutdown(); - //取消监听 - EventDispatcher.stopListen(listener); - splashStrategy.hide(); - // 一次性 - splashStrategy = null; + if (splashStrategy != null) { + // 窗口关闭后取消定时获取模块信息的timer + scheduler.shutdown(); + //取消监听 + EventDispatcher.stopListen(listener); + splashStrategy.hide(); + // 一次性 + splashStrategy = null; + } } private void initListener() { diff --git a/designer-realize/src/main/java/com/fr/start/module/DesignerInitActivator.java b/designer-realize/src/main/java/com/fr/start/module/DesignerInitActivator.java new file mode 100644 index 0000000000..1eeb5a6a3a --- /dev/null +++ b/designer-realize/src/main/java/com/fr/start/module/DesignerInitActivator.java @@ -0,0 +1,25 @@ +package com.fr.start.module; + +import com.fr.module.Activator; +import com.fr.start.DesignerInitial; + +/** + * 设计器界面初始化 + * + * @author vito + * @version 10.0 + * Created by vito on 2019/9/25 + */ +public class DesignerInitActivator extends Activator { + + + @Override + public void start() { + DesignerInitial.init(findSingleton(StartupArgs.class).get()); + } + + @Override + public void stop() { + // void + } +} diff --git a/designer-realize/src/main/java/com/fr/start/module/DesignerShowActivator.java b/designer-realize/src/main/java/com/fr/start/module/DesignerShowActivator.java index d41db181f9..d0c27bcc4a 100644 --- a/designer-realize/src/main/java/com/fr/start/module/DesignerShowActivator.java +++ b/designer-realize/src/main/java/com/fr/start/module/DesignerShowActivator.java @@ -13,7 +13,7 @@ public class DesignerShowActivator extends Activator { @Override public void start() { - DesignerInitial.init(findSingleton(StartupArgs.class).get()); +// DesignerInitial.init(findSingleton(StartupArgs.class).get()); EventDispatcher.asyncFire(ModuleEvent.MajorModuleStarting, Toolkit.i18nText("Fine-Design_Module_Name_Designer")); DesignerInitial.prepare(); } diff --git a/designer-realize/src/main/java/com/fr/start/module/DesignerStartup.java b/designer-realize/src/main/java/com/fr/start/module/DesignerStartup.java index c43fc8be81..1d781d31ec 100644 --- a/designer-realize/src/main/java/com/fr/start/module/DesignerStartup.java +++ b/designer-realize/src/main/java/com/fr/start/module/DesignerStartup.java @@ -70,7 +70,7 @@ public class DesignerStartup extends Activator { @Metrics public void start() { startSub(PreStartActivator.class); - startSub(DesignerWorkspaceActivator.class); + startSub("parallel"); //designer模块启动好后,查看demo browserDemoIfNeeded(); startupEmbedServerIfNeeded();