|
|
@ -9,7 +9,6 @@ import com.fr.start.SplashContext; |
|
|
|
import com.fr.start.common.DesignerStartupContext; |
|
|
|
import com.fr.start.common.DesignerStartupContext; |
|
|
|
import com.fr.start.module.StartupArgs; |
|
|
|
import com.fr.start.module.StartupArgs; |
|
|
|
import com.fr.start.util.DesignerStartupPageUtil; |
|
|
|
import com.fr.start.util.DesignerStartupPageUtil; |
|
|
|
import com.fr.start.warmup.DesignerPreWarmTask; |
|
|
|
|
|
|
|
import com.fr.startup.metric.DesignerMetrics; |
|
|
|
import com.fr.startup.metric.DesignerMetrics; |
|
|
|
import com.fr.startup.metric.DesignerStartupModel; |
|
|
|
import com.fr.startup.metric.DesignerStartupModel; |
|
|
|
import com.fr.startup.ui.StartupPageModel; |
|
|
|
import com.fr.startup.ui.StartupPageModel; |
|
|
@ -63,10 +62,6 @@ public class DesignerStartupPageActivator extends Activator { |
|
|
|
// 启动页关闭
|
|
|
|
// 启动页关闭
|
|
|
|
SplashContext.getInstance().hide(); |
|
|
|
SplashContext.getInstance().hide(); |
|
|
|
|
|
|
|
|
|
|
|
// 预热任务启动
|
|
|
|
|
|
|
|
DesignerPreWarmTask warmTask = new DesignerPreWarmTask(); |
|
|
|
|
|
|
|
warmTask.start(); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// 即时暂停
|
|
|
|
// 即时暂停
|
|
|
|
suspendRecorder(context); |
|
|
|
suspendRecorder(context); |
|
|
|
|
|
|
|
|
|
|
@ -79,21 +74,21 @@ public class DesignerStartupPageActivator extends Activator { |
|
|
|
model.setOpenLastTemplateRunnable(() -> { |
|
|
|
model.setOpenLastTemplateRunnable(() -> { |
|
|
|
context.setOpenLastFile(true); |
|
|
|
context.setOpenLastFile(true); |
|
|
|
handleModel(model); |
|
|
|
handleModel(model); |
|
|
|
launchAfterWarmup(warmTask); |
|
|
|
launchAfterWarmup(); |
|
|
|
}); |
|
|
|
}); |
|
|
|
|
|
|
|
|
|
|
|
// selectAndOpenEmpty
|
|
|
|
// selectAndOpenEmpty
|
|
|
|
model.setOpenEmptyTemplateRunnable(() -> { |
|
|
|
model.setOpenEmptyTemplateRunnable(() -> { |
|
|
|
context.setOpenEmpty(true); |
|
|
|
context.setOpenEmpty(true); |
|
|
|
handleModel(model); |
|
|
|
handleModel(model); |
|
|
|
launchAfterWarmup(warmTask); |
|
|
|
launchAfterWarmup(); |
|
|
|
}); |
|
|
|
}); |
|
|
|
|
|
|
|
|
|
|
|
// selectAndCreateNew
|
|
|
|
// selectAndCreateNew
|
|
|
|
model.setCreateNewTemplateRunnable(() -> { |
|
|
|
model.setCreateNewTemplateRunnable(() -> { |
|
|
|
context.setCreateNew(true); |
|
|
|
context.setCreateNew(true); |
|
|
|
handleModel(model); |
|
|
|
handleModel(model); |
|
|
|
launchAfterWarmup(warmTask); |
|
|
|
launchAfterWarmup(); |
|
|
|
}); |
|
|
|
}); |
|
|
|
|
|
|
|
|
|
|
|
StartupPageWindow window = new StartupPageWindow(model); |
|
|
|
StartupPageWindow window = new StartupPageWindow(model); |
|
|
@ -123,7 +118,7 @@ public class DesignerStartupPageActivator extends Activator { |
|
|
|
}); |
|
|
|
}); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
private void launchAfterWarmup(DesignerPreWarmTask warmTask) { |
|
|
|
private void launchAfterWarmup() { |
|
|
|
|
|
|
|
|
|
|
|
StopWatch stopWatch = StopWatch.createStarted(); |
|
|
|
StopWatch stopWatch = StopWatch.createStarted(); |
|
|
|
|
|
|
|
|
|
|
@ -133,9 +128,6 @@ public class DesignerStartupPageActivator extends Activator { |
|
|
|
// 等待中切换
|
|
|
|
// 等待中切换
|
|
|
|
DesignerStartupContext.getInstance().setOnWaiting(false); |
|
|
|
DesignerStartupContext.getInstance().setOnWaiting(false); |
|
|
|
|
|
|
|
|
|
|
|
warmTask.join(); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
FineLoggerFactory.getLogger().debug("designer-startup-page warm up cost {} ms", stopWatch.getTime(TimeUnit.MILLISECONDS)); |
|
|
|
|
|
|
|
DesignerStartupContext.getInstance().setOnStartup(true); |
|
|
|
DesignerStartupContext.getInstance().setOnStartup(true); |
|
|
|
DesignerStartupPageUtil.enterWorkspace(); |
|
|
|
DesignerStartupPageUtil.enterWorkspace(); |
|
|
|
} finally { |
|
|
|
} finally { |
|
|
|