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.
59 lines
1.8 KiB
59 lines
1.8 KiB
package com.fr.start.module; |
|
|
|
import com.fr.design.DesignerEnvManager; |
|
import com.fr.design.RestartHelper; |
|
import com.fr.design.constants.DesignerLaunchStatus; |
|
import com.fr.design.file.TemplateResourceManager; |
|
import com.fr.design.utils.DesignUtils; |
|
import com.fr.event.Event; |
|
import com.fr.event.EventDispatcher; |
|
import com.fr.event.Listener; |
|
import com.fr.event.Null; |
|
import com.fr.file.TmpFileUtils; |
|
import com.fr.general.CloudCenter; |
|
import com.fr.general.GeneralContext; |
|
import com.fr.module.Activator; |
|
import com.fr.start.common.DesignerStartupPool; |
|
|
|
/** |
|
* Created by juhaoyu on 2018/1/8. |
|
*/ |
|
public class PreStartActivator extends Activator { |
|
|
|
@Override |
|
public void start() { |
|
//清空临时文件 |
|
Runtime.getRuntime().addShutdownHook(new Thread(TmpFileUtils::cleanUpInnerTmpFiles)); |
|
|
|
RestartHelper.deleteRecordFilesWhenStart(); |
|
//初始化起始画面放到 SplashContext 里面 |
|
//EventDispatcher.fire(ModuleEvent.MajorModuleStarting, Toolkit.i18nText("Fine-Design_Basic_Initializing")); |
|
|
|
// 完成初始化 |
|
//noinspection ResultOfMethodCallIgnored |
|
CloudCenter.getInstance(); |
|
|
|
// 创建监听服务 |
|
DesignUtils.createListeningServer(DesignUtils.getPort(), startFileSuffix()); |
|
|
|
// 在插件引擎模块起来前 初始化下插件接口监听 |
|
TemplateResourceManager.getResource(); |
|
|
|
initLanguage(); |
|
} |
|
|
|
@Override |
|
public void stop() { |
|
// void |
|
} |
|
|
|
private void initLanguage() { |
|
//这两句的位置不能随便调换,因为会影响语言切换的问题 |
|
GeneralContext.setLocale(DesignerEnvManager.getEnvManager(false).getLanguage()); |
|
} |
|
|
|
private String[] startFileSuffix() { |
|
|
|
return new String[]{".cpt", ".xls", ".xlsx", ".frm", ".form", ".cht", ".chart", ".fvs"}; |
|
} |
|
}
|
|
|