|
|
@ -3,7 +3,11 @@ package com.fr.start.module.optimized; |
|
|
|
import com.fr.module.Activator; |
|
|
|
import com.fr.module.Activator; |
|
|
|
import com.fr.module.ModuleContext; |
|
|
|
import com.fr.module.ModuleContext; |
|
|
|
import com.fr.plugin.PluginActivator; |
|
|
|
import com.fr.plugin.PluginActivator; |
|
|
|
|
|
|
|
import com.fr.plugin.manage.PluginManager; |
|
|
|
import com.fr.start.common.DesignerStartupExecutor; |
|
|
|
import com.fr.start.common.DesignerStartupExecutor; |
|
|
|
|
|
|
|
import com.fr.workspace.WorkContext; |
|
|
|
|
|
|
|
import com.fr.workspace.WorkspaceSwitchHelper; |
|
|
|
|
|
|
|
import com.fr.workspace.WorkspaceSwitchProcess; |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
|
* created by Harrison on 2022/06/22 |
|
|
|
* created by Harrison on 2022/06/22 |
|
|
@ -12,13 +16,21 @@ public class DesignerPluginActivator extends Activator { |
|
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
@Override |
|
|
|
public void start() { |
|
|
|
public void start() { |
|
|
|
|
|
|
|
WorkspaceSwitchProcess process = WorkContext.getSwitcher().getProcess(); |
|
|
|
|
|
|
|
if (WorkspaceSwitchHelper.supportHotSwitch(process)) { |
|
|
|
|
|
|
|
PluginManager.getHotModule().start(); |
|
|
|
|
|
|
|
} else { |
|
|
|
DesignerStartupExecutor.getInstance().execute(() -> ModuleContext.getModule(PluginActivator.class).start()); |
|
|
|
DesignerStartupExecutor.getInstance().execute(() -> ModuleContext.getModule(PluginActivator.class).start()); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
@Override |
|
|
|
public void stop() { |
|
|
|
public void stop() { |
|
|
|
|
|
|
|
WorkspaceSwitchProcess process = WorkContext.getSwitcher().getProcess(); |
|
|
|
|
|
|
|
if (WorkspaceSwitchHelper.supportHotSwitch(process)) { |
|
|
|
|
|
|
|
PluginManager.getHotModule().stop(); |
|
|
|
|
|
|
|
} else { |
|
|
|
ModuleContext.getModule(PluginActivator.class).stop(); |
|
|
|
ModuleContext.getModule(PluginActivator.class).stop(); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|