Removed stupid 3 seconds wait on python console launch (PY-2282)
authorDmitry Trofimov <dmitry.trofimov@jetbrains.com>
Tue, 15 Feb 2011 17:06:27 +0000 (20:06 +0300)
committerDmitry Trofimov <dmitry.trofimov@jetbrains.com>
Tue, 15 Feb 2011 19:06:51 +0000 (22:06 +0300)
platform/lang-impl/src/com/intellij/execution/runners/AbstractConsoleRunnerWithHistory.java

index 21bed94c185054da87b754365c73133b41c16cc1..ef936fc4706bb9c00bb4f20e8839d5e6fd203d77 100644 (file)
@@ -108,14 +108,7 @@ public abstract class AbstractConsoleRunnerWithHistory {
     myProcessHandler.addProcessListener(new ProcessAdapter() {
       @Override
       public void processTerminated(ProcessEvent event) {
-        myRunAction.getTemplatePresentation().setEnabled(false);
-        myConsoleView.getConsole().setPrompt("");
-        myConsoleView.getConsole().getConsoleEditor().setRendererMode(true);
-        ApplicationManager.getApplication().invokeLater(new Runnable() {
-          public void run() {
-            myConsoleView.getConsole().getConsoleEditor().getComponent().updateUI();
-          }
-        });
+        finishConsole();
       }
     });
 
@@ -155,6 +148,17 @@ public abstract class AbstractConsoleRunnerWithHistory {
     myProcessHandler.startNotify();
   }
 
+  protected void finishConsole() {
+    myRunAction.getTemplatePresentation().setEnabled(false);
+    myConsoleView.getConsole().setPrompt("");
+    myConsoleView.getConsole().getConsoleEditor().setRendererMode(true);
+    ApplicationManager.getApplication().invokeLater(new Runnable() {
+      public void run() {
+        myConsoleView.getConsole().getConsoleEditor().getComponent().updateUI();
+      }
+    });
+  }
+
   protected abstract LanguageConsoleViewImpl createConsoleView();
 
   @Nullable