diff --git a/python/src/com/jetbrains/python/console/PyOpenDebugConsoleAction.java b/python/src/com/jetbrains/python/console/PyOpenDebugConsoleAction.java index 3f4e8011c88a..45906d513f21 100644 --- a/python/src/com/jetbrains/python/console/PyOpenDebugConsoleAction.java +++ b/python/src/com/jetbrains/python/console/PyOpenDebugConsoleAction.java @@ -22,7 +22,6 @@ import com.intellij.openapi.actionSystem.AnAction; import com.intellij.openapi.actionSystem.AnActionEvent; import com.intellij.openapi.actionSystem.CommonDataKeys; import com.intellij.openapi.actionSystem.DataContext; -import com.intellij.openapi.actionSystem.PlatformDataKeys; import com.intellij.openapi.project.DumbAware; import com.intellij.openapi.project.Project; import com.intellij.openapi.wm.IdeFocusManager; @@ -53,6 +52,7 @@ public class PyOpenDebugConsoleAction extends AnAction implements DumbAware { } } + @Override public void actionPerformed(final AnActionEvent e) { final Project project = e.getData(CommonDataKeys.PROJECT); if (project != null) { diff --git a/python/src/com/jetbrains/python/console/PythonDebugLanguageConsoleView.java b/python/src/com/jetbrains/python/console/PythonDebugLanguageConsoleView.java index b807b3c0a54b..495c26df74c8 100644 --- a/python/src/com/jetbrains/python/console/PythonDebugLanguageConsoleView.java +++ b/python/src/com/jetbrains/python/console/PythonDebugLanguageConsoleView.java @@ -63,7 +63,7 @@ public class PythonDebugLanguageConsoleView extends JPanel implements ConsoleVie public PythonDebugLanguageConsoleView(final Project project, Sdk sdk, ConsoleView consoleView) { super(new CardLayout()); - myPydevConsoleView = createConsoleView(project, sdk); + myPydevConsoleView = new PythonConsoleView(project, "Python Console", sdk); myTextConsole = consoleView; add(myTextConsole.getComponent(), TEXT_CONSOLE_PANEL); @@ -85,10 +85,6 @@ public class PythonDebugLanguageConsoleView extends JPanel implements ConsoleVie getPydevConsoleView().executeCode(code, e); } - private static PythonConsoleView createConsoleView(Project project, Sdk sdk) { - return new PythonConsoleView(project, "Python Console", sdk); - } - private void doShowConsole(String type) { CardLayout cl = (CardLayout)(getLayout()); cl.show(this, type); diff --git a/python/src/com/jetbrains/python/debugger/PyDebugRunner.java b/python/src/com/jetbrains/python/debugger/PyDebugRunner.java index bec10b801ae0..3199200de432 100644 --- a/python/src/com/jetbrains/python/debugger/PyDebugRunner.java +++ b/python/src/com/jetbrains/python/debugger/PyDebugRunner.java @@ -40,7 +40,6 @@ import com.jetbrains.python.PythonHelpersLocator; import com.jetbrains.python.console.PythonConsoleView; import com.jetbrains.python.console.PythonDebugConsoleCommunication; import com.jetbrains.python.console.PythonDebugLanguageConsoleView; -import com.jetbrains.python.console.pydev.ConsoleCommunication; import com.jetbrains.python.run.AbstractPythonRunConfiguration; import com.jetbrains.python.run.CommandLinePatcher; import com.jetbrains.python.run.PythonCommandLineState; @@ -123,19 +122,14 @@ public class PyDebugRunner extends GenericProgramRunner { @NotNull final ExecutionResult result, @NotNull PyDebugProcess debugProcess) { ExecutionConsole console = result.getExecutionConsole(); - ProcessHandler processHandler = result.getProcessHandler(); - if (console instanceof PythonDebugLanguageConsoleView) { PythonConsoleView pythonConsoleView = ((PythonDebugLanguageConsoleView)console).getPydevConsoleView(); + pythonConsoleView.setConsoleCommunication(new PythonDebugConsoleCommunication(project, debugProcess)); - - ConsoleCommunication consoleCommunication = new PythonDebugConsoleCommunication(project, debugProcess); - pythonConsoleView.setConsoleCommunication(consoleCommunication); - + ProcessHandler processHandler = result.getProcessHandler(); PydevDebugConsoleExecuteActionHandler consoleExecuteActionHandler = new PydevDebugConsoleExecuteActionHandler(pythonConsoleView, processHandler, - consoleCommunication); - + new PythonDebugConsoleCommunication(project, debugProcess)); pythonConsoleView.setExecutionHandler(consoleExecuteActionHandler); debugProcess.getSession().addSessionListener(consoleExecuteActionHandler);