|
|
@ -1,11 +1,15 @@ |
|
|
|
package com.fr.start.module; |
|
|
|
package com.fr.start.module; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
import com.fr.design.mainframe.CellElementPropertyPane; |
|
|
|
import com.fr.design.mainframe.DesignerContext; |
|
|
|
import com.fr.design.mainframe.DesignerContext; |
|
|
|
|
|
|
|
import com.fr.design.mainframe.DesignerFrameFileDealerPane; |
|
|
|
import com.fr.event.Event; |
|
|
|
import com.fr.event.Event; |
|
|
|
import com.fr.event.Listener; |
|
|
|
import com.fr.event.Listener; |
|
|
|
|
|
|
|
import com.fr.form.ui.WidgetInfoConfig; |
|
|
|
import com.fr.module.Activator; |
|
|
|
import com.fr.module.Activator; |
|
|
|
import com.fr.start.Designer; |
|
|
|
import com.fr.start.Designer; |
|
|
|
import com.fr.start.EnvSwitcher; |
|
|
|
import com.fr.start.EnvSwitcher; |
|
|
|
|
|
|
|
import com.fr.start.ServerStarter; |
|
|
|
import com.fr.start.SplashContext; |
|
|
|
import com.fr.start.SplashContext; |
|
|
|
import com.fr.startup.activators.BasicActivator; |
|
|
|
import com.fr.startup.activators.BasicActivator; |
|
|
|
import com.fr.workspace.Workspace; |
|
|
|
import com.fr.workspace.Workspace; |
|
|
@ -26,6 +30,7 @@ public class DesignerStartup extends Activator { |
|
|
|
startSub(BasicActivator.class); |
|
|
|
startSub(BasicActivator.class); |
|
|
|
final String[] args = getModule().upFindSingleton(StartupArgs.class).get(); |
|
|
|
final String[] args = getModule().upFindSingleton(StartupArgs.class).get(); |
|
|
|
final Designer designer = new Designer(args); |
|
|
|
final Designer designer = new Designer(args); |
|
|
|
|
|
|
|
preLoadSomething(); |
|
|
|
//启动env
|
|
|
|
//启动env
|
|
|
|
startSub(DesignerWorkspaceProvider.class); |
|
|
|
startSub(DesignerWorkspaceProvider.class); |
|
|
|
startSub(EnvBasedModule.class); |
|
|
|
startSub(EnvBasedModule.class); |
|
|
@ -43,34 +48,61 @@ public class DesignerStartup extends Activator { |
|
|
|
DesignerContext.getDesignerFrame().setVisible(true); |
|
|
|
DesignerContext.getDesignerFrame().setVisible(true); |
|
|
|
//启动画面结束
|
|
|
|
//启动画面结束
|
|
|
|
SplashContext.getInstance().hide(); |
|
|
|
SplashContext.getInstance().hide(); |
|
|
|
|
|
|
|
|
|
|
|
DesignerContext.getDesignerFrame().getProgressDialog().setVisible(true); |
|
|
|
DesignerContext.getDesignerFrame().getProgressDialog().setVisible(true); |
|
|
|
startSub(StartFinishActivator.class); |
|
|
|
startSub(StartFinishActivator.class); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
|
|
|
* 基础模块结束后可以提前加载一部分依赖基础模块(国际化,图标样式之类)的东西 |
|
|
|
|
|
|
|
*/ |
|
|
|
|
|
|
|
private void preLoadSomething(){ |
|
|
|
|
|
|
|
ExecutorService service = Executors.newCachedThreadPool(); |
|
|
|
|
|
|
|
service.submit(new Runnable() { |
|
|
|
|
|
|
|
@Override |
|
|
|
|
|
|
|
public void run() { |
|
|
|
|
|
|
|
CellElementPropertyPane.getInstance(); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
}); |
|
|
|
|
|
|
|
service.submit(new Runnable() { |
|
|
|
|
|
|
|
@Override |
|
|
|
|
|
|
|
public void run() { |
|
|
|
|
|
|
|
DesignerFrameFileDealerPane.getInstance();//这边会涉及到TemplateTreePane
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
}); |
|
|
|
|
|
|
|
service.submit(new Runnable() { |
|
|
|
|
|
|
|
@Override |
|
|
|
|
|
|
|
public void run() { |
|
|
|
|
|
|
|
WidgetInfoConfig.getInstance(); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
}); |
|
|
|
|
|
|
|
service.shutdown(); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
|
* 切换环境时,重新启动所有相关模块 |
|
|
|
* 切换环境时,重新启动所有相关模块 |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
private void registerEnvListener() { |
|
|
|
private void registerEnvListener() { |
|
|
|
|
|
|
|
|
|
|
|
listenEvent(WorkspaceEvent.BeforeSwitch, new Listener<Workspace>() { |
|
|
|
listenEvent(WorkspaceEvent.BeforeSwitch, new Listener<Workspace>() { |
|
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
@Override |
|
|
|
public void on(Event event, Workspace param) { |
|
|
|
public void on(Event event, Workspace param) { |
|
|
|
|
|
|
|
|
|
|
|
getSub(EnvBasedModule.class).stop(); |
|
|
|
getSub(EnvBasedModule.class).stop(); |
|
|
|
} |
|
|
|
} |
|
|
|
}); |
|
|
|
}); |
|
|
|
listenEvent(WorkspaceEvent.AfterSwitch, new Listener<Workspace>() { |
|
|
|
listenEvent(WorkspaceEvent.AfterSwitch, new Listener<Workspace>() { |
|
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
@Override |
|
|
|
public void on(Event event, Workspace param) { |
|
|
|
public void on(Event event, Workspace param) { |
|
|
|
|
|
|
|
|
|
|
|
getSub(EnvBasedModule.class).start(); |
|
|
|
getSub(EnvBasedModule.class).start(); |
|
|
|
} |
|
|
|
} |
|
|
|
}); |
|
|
|
}); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
@Override |
|
|
|
public void stop() { |
|
|
|
public void stop() { |
|
|
|
|
|
|
|
|
|
|
|