|
|
|
@ -1,5 +1,6 @@
|
|
|
|
|
package com.fr.start.module.optimized; |
|
|
|
|
|
|
|
|
|
import com.fr.design.DesignerEnvManager; |
|
|
|
|
import com.fr.design.ui.util.UIUtil; |
|
|
|
|
import com.fr.log.FineLoggerFactory; |
|
|
|
|
import com.fr.module.Activator; |
|
|
|
@ -10,6 +11,7 @@ import com.fr.start.util.DesignerStartupPageUtil;
|
|
|
|
|
import com.fr.start.warmup.DesignerPreWarmTask; |
|
|
|
|
import com.fr.startup.ui.StartupPageModel; |
|
|
|
|
import com.fr.startup.ui.StartupPageWindow; |
|
|
|
|
import com.fr.startup.ui.StartupWorkspaceBean; |
|
|
|
|
import com.fr.third.org.apache.commons.lang3.time.StopWatch; |
|
|
|
|
import com.fr.value.NotNullLazyValue; |
|
|
|
|
import org.jetbrains.annotations.NotNull; |
|
|
|
@ -66,18 +68,21 @@ public class DesignerStartupPageActivator extends Activator {
|
|
|
|
|
// selectAndOpenLast
|
|
|
|
|
model.setOpenLastTemplateRunnable(() -> { |
|
|
|
|
context.setOpenLastFile(true); |
|
|
|
|
handleModel(model); |
|
|
|
|
launchAfterWarmup(warmTask); |
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
// selectAndOpenEmpty
|
|
|
|
|
model.setOpenEmptyTemplateRunnable(() -> { |
|
|
|
|
context.setOpenEmpty(true); |
|
|
|
|
handleModel(model); |
|
|
|
|
launchAfterWarmup(warmTask); |
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
// selectAndCreateNew
|
|
|
|
|
model.setCreateNewTemplateRunnable(() -> { |
|
|
|
|
context.setCreateNew(true); |
|
|
|
|
handleModel(model); |
|
|
|
|
launchAfterWarmup(warmTask); |
|
|
|
|
}); |
|
|
|
|
|
|
|
|
@ -87,6 +92,13 @@ public class DesignerStartupPageActivator extends Activator {
|
|
|
|
|
}); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
private void handleModel(StartupPageModel model) { |
|
|
|
|
|
|
|
|
|
// 将选中的环境设置为当前环境
|
|
|
|
|
StartupWorkspaceBean selectWorkspaceInfo = model.getSelectWorkspaceInfo(); |
|
|
|
|
DesignerEnvManager.getEnvManager().setCurEnvName(selectWorkspaceInfo.getName()); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
private void launchAfterWarmup(DesignerPreWarmTask warmTask) { |
|
|
|
|
|
|
|
|
|
StopWatch stopWatch = StopWatch.createStarted(); |
|
|
|
|