帆软报表设计器源代码。
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.

66 lines
1.8 KiB

package com.fr.start.module;
import com.fr.core.env.EnvConfig;
import com.fr.core.env.EnvEvent;
import com.fr.event.Event;
import com.fr.event.Listener;
import com.fr.module.Activator;
import com.fr.start.Designer;
import com.fr.start.EnvSwitcher;
import com.fr.start.SplashContext;
import com.fr.startup.activators.BasicActivator;
/**
* Created by juhaoyu on 2018/1/8.
*/
public class DesignerStartup extends Activator {
@Override
public void start() {
startSub(PreStartActivator.class);
//启动基础部分
startSub(BasicActivator.class);
String[] args = getModule().upFindSingleton(StartupArgs.class).get();
Designer designer = new Designer(args);
//启动env
startSub(DesignerEnvProvider.class);
getSub(EnvBasedModule.class).start();
getRoot().getSingleton(EnvSwitcher.class).switch2LastEnv();
registerEnvListener();
//启动设计器界面
designer.show(args);
//启动画面结束
SplashContext.getInstance().hide();
startSub(StartFinishActivator.class);
}
/**
* 切换环境时重新启动所有相关模块
*/
private void registerEnvListener() {
listenEvent(EnvEvent.BEFORE_SIGN_OUT, new Listener<EnvConfig>() {
@Override
public void on(Event event, EnvConfig param) {
getSub(EnvBasedModule.class).stop();
}
});
listenEvent(EnvEvent.AFTER_SIGN_IN, new Listener<EnvConfig>() {
@Override
public void on(Event event, EnvConfig param) {
getSub(EnvBasedModule.class).start();
}
});
}
@Override
public void stop() {
}
}