cmd: unify ApplicationStarter initialisation

This commit is contained in:
Aleksey Pivovarov
2018-11-08 17:07:55 +03:00
parent a5666cdfca
commit fdc6ddb1ef
@@ -94,6 +94,8 @@ public class IdeaApplication {
boolean headless = Main.isHeadless();
patchSystem(headless);
myStarter = getStarter();
if (Main.isCommandLine()) {
if (CommandLineApplication.ourInstance == null) {
new CommandLineApplication(isInternal, isUnitTest, headless);
@@ -104,20 +106,13 @@ public class IdeaApplication {
}
else {
Splash splash = null;
//if (myArgs.length == 0) {
myStarter = getStarter();
if (isShowSplash && myStarter instanceof IdeStarter) {
splash = ((IdeStarter)myStarter).showSplash();
}
//}
ApplicationManagerEx.createApplication(isInternal, isUnitTest, false, false, ApplicationManagerEx.IDEA_APPLICATION, splash);
}
if (myStarter == null) {
myStarter = getStarter();
}
if (headless && myStarter instanceof ApplicationStarterEx && !((ApplicationStarterEx)myStarter).isHeadless()) {
Main.showMessage("Startup Error", "Application cannot start in headless mode", true);
System.exit(Main.NO_GRAPHICS);