You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
42 lines
1.1 KiB
42 lines
1.1 KiB
7 years ago
|
package com.fr.start.module;
|
||
|
|
||
|
import com.fr.design.DesignerEnvManager;
|
||
|
import com.fr.general.ComparatorUtils;
|
||
|
import com.fr.module.Activator;
|
||
7 years ago
|
import com.fr.start.EnvSwitcher;
|
||
7 years ago
|
import com.fr.start.StartServer;
|
||
|
|
||
|
/**
|
||
|
* Created by juhaoyu on 2018/1/8.
|
||
|
* 设计器启动时的环境相关模块activator
|
||
|
*/
|
||
7 years ago
|
public class DesignerEnvProvider extends Activator {
|
||
7 years ago
|
|
||
|
@Override
|
||
|
public void start() {
|
||
|
|
||
7 years ago
|
String[] args = getModule().upFindSingleton(StartupArgs.class).get();
|
||
7 years ago
|
if (args != null) {
|
||
|
for (String arg : args) {
|
||
|
if (ComparatorUtils.equals(arg, "demo")) {
|
||
|
DesignerEnvManager.getEnvManager().setCurrentEnv2Default();
|
||
|
StartServer.browserDemoURL();
|
||
|
break;
|
||
|
}
|
||
|
}
|
||
|
}
|
||
7 years ago
|
getRoot().setSingleton(EnvSwitcher.class, new EnvSwitcher());
|
||
7 years ago
|
//设置好环境即可,具体跟环境有关的模块会自动调用
|
||
7 years ago
|
getRoot().getSingleton(EnvSwitcher.class).switch2LastEnv();
|
||
7 years ago
|
}
|
||
|
|
||
|
|
||
7 years ago
|
|
||
7 years ago
|
|
||
|
@Override
|
||
|
public void stop() {
|
||
|
//清空模块
|
||
7 years ago
|
getRoot().removeSingleton(EnvSwitcher.class);
|
||
7 years ago
|
}
|
||
|
}
|