Search in sources :

Example 1 with PythonDebugLanguageConsoleView

use of com.jetbrains.python.console.PythonDebugLanguageConsoleView in project intellij-community by JetBrains.

the class PyDebugProcess method showConsole.

@Override
public void showConsole(PyThreadInfo thread) {
    myConsoleContextFrame = new PyExecutionStack(this, thread).getTopFrame();
    if (myExecutionConsole instanceof PythonDebugLanguageConsoleView) {
        PythonDebugLanguageConsoleView consoleView = (PythonDebugLanguageConsoleView) myExecutionConsole;
        UIUtil.invokeLaterIfNeeded(() -> {
            consoleView.enableConsole(false);
            consoleView.getPydevConsoleView().setConsoleEnabled(true);
        });
    }
}
Also used : PythonDebugLanguageConsoleView(com.jetbrains.python.console.PythonDebugLanguageConsoleView)

Example 2 with PythonDebugLanguageConsoleView

use of com.jetbrains.python.console.PythonDebugLanguageConsoleView in project intellij-community by JetBrains.

the class PyEduDebugProcess method createTabLayouter.

@NotNull
@Override
public XDebugTabLayouter createTabLayouter() {
    return new XDebugTabLayouter() {

        @NotNull
        @Override
        public Content registerConsoleContent(@NotNull RunnerLayoutUi ui, @NotNull ExecutionConsole console) {
            final PythonDebugLanguageConsoleView view = ((PythonDebugLanguageConsoleView) console);
            view.initialized();
            view.enableConsole(false);
            Content eduConsole = ui.createContent("EduConsole", view.getComponent(), XDebuggerBundle.message("debugger.session.tab.console.content.name"), AllIcons.Debugger.ToolConsole, view.getPreferredFocusableComponent());
            eduConsole.setCloseable(false);
            ui.addContent(eduConsole, 0, PlaceInGrid.right, false);
            return eduConsole;
        }
    };
}
Also used : RunnerLayoutUi(com.intellij.execution.ui.RunnerLayoutUi) PythonDebugLanguageConsoleView(com.jetbrains.python.console.PythonDebugLanguageConsoleView) Content(com.intellij.ui.content.Content) XDebugTabLayouter(com.intellij.xdebugger.ui.XDebugTabLayouter) ExecutionConsole(com.intellij.execution.ui.ExecutionConsole) NotNull(org.jetbrains.annotations.NotNull) NotNull(org.jetbrains.annotations.NotNull)

Example 3 with PythonDebugLanguageConsoleView

use of com.jetbrains.python.console.PythonDebugLanguageConsoleView in project intellij-community by JetBrains.

the class PyEduDebugRunner method initSession.

@Override
protected void initSession(XDebugSession session, RunProfileState state, Executor executor) {
    XDebugSessionTab tab = ((XDebugSessionImpl) session).getSessionTab();
    if (tab != null) {
        RunnerLayoutUi ui = tab.getUi();
        ContentManager contentManager = ui.getContentManager();
        Content content = findContent(contentManager, XDebuggerBundle.message("debugger.session.tab.console.content.name"));
        if (content != null) {
            ExecutionConsole console = session.getDebugProcess().createConsole();
            PythonDebugLanguageConsoleView view = (PythonDebugLanguageConsoleView) console;
            Presentation presentation = view.getSwitchConsoleActionPresentation();
            ToggleAction action = new ToggleAction(presentation.getText(), presentation.getDescription(), presentation.getIcon()) {

                @Override
                public boolean isSelected(AnActionEvent e) {
                    return !view.isPrimaryConsoleEnabled();
                }

                @Override
                public void setSelected(AnActionEvent e, boolean state) {
                    view.enableConsole(!state);
                }
            };
            content.setActions(new DefaultActionGroup(action), ActionPlaces.DEBUGGER_TOOLBAR, view.getPreferredFocusableComponent());
        }
        patchLeftToolbar(session, ui);
    }
}
Also used : RunnerLayoutUi(com.intellij.execution.ui.RunnerLayoutUi) XDebugSessionTab(com.intellij.xdebugger.impl.ui.XDebugSessionTab) PythonDebugLanguageConsoleView(com.jetbrains.python.console.PythonDebugLanguageConsoleView) Content(com.intellij.ui.content.Content) ContentManager(com.intellij.ui.content.ContentManager) ExecutionConsole(com.intellij.execution.ui.ExecutionConsole) XDebugSessionImpl(com.intellij.xdebugger.impl.XDebugSessionImpl)

Example 4 with PythonDebugLanguageConsoleView

use of com.jetbrains.python.console.PythonDebugLanguageConsoleView in project intellij-community by JetBrains.

the class PythonTestCommandLineStateBase method createAndAttachConsole.

@Override
@NotNull
protected ConsoleView createAndAttachConsole(Project project, ProcessHandler processHandler, Executor executor) throws ExecutionException {
    final PythonTRunnerConsoleProperties consoleProperties = createConsoleProperties(executor);
    if (isDebug()) {
        final ConsoleView testsOutputConsoleView = SMTestRunnerConnectionUtil.createConsole(PythonTRunnerConsoleProperties.FRAMEWORK_NAME, consoleProperties);
        final ConsoleView consoleView = new PythonDebugLanguageConsoleView(project, PythonSdkType.findSdkByPath(myConfiguration.getInterpreterPath()), testsOutputConsoleView);
        consoleView.attachToProcess(processHandler);
        addTracebackFilter(project, consoleView, processHandler);
        return consoleView;
    }
    final ConsoleView consoleView = SMTestRunnerConnectionUtil.createAndAttachConsole(PythonTRunnerConsoleProperties.FRAMEWORK_NAME, processHandler, consoleProperties);
    addTracebackFilter(project, consoleView, processHandler);
    return consoleView;
}
Also used : PythonDebugLanguageConsoleView(com.jetbrains.python.console.PythonDebugLanguageConsoleView) SMTRunnerConsoleView(com.intellij.execution.testframework.sm.runner.ui.SMTRunnerConsoleView) BaseTestsOutputConsoleView(com.intellij.execution.testframework.ui.BaseTestsOutputConsoleView) ConsoleView(com.intellij.execution.ui.ConsoleView) PythonDebugLanguageConsoleView(com.jetbrains.python.console.PythonDebugLanguageConsoleView) NotNull(org.jetbrains.annotations.NotNull)

Example 5 with PythonDebugLanguageConsoleView

use of com.jetbrains.python.console.PythonDebugLanguageConsoleView in project intellij-community by JetBrains.

the class PyDebugRunner method createConsoleCommunicationAndSetupActions.

public static void createConsoleCommunicationAndSetupActions(@NotNull final Project project, @NotNull final ExecutionResult result, @NotNull PyDebugProcess debugProcess, @NotNull XDebugSession session) {
    ExecutionConsole console = result.getExecutionConsole();
    if (console instanceof PythonDebugLanguageConsoleView) {
        ProcessHandler processHandler = result.getProcessHandler();
        initDebugConsoleView(project, debugProcess, (PythonDebugLanguageConsoleView) console, processHandler, session);
    }
}
Also used : PythonDebugLanguageConsoleView(com.jetbrains.python.console.PythonDebugLanguageConsoleView) ProcessHandler(com.intellij.execution.process.ProcessHandler) ExecutionConsole(com.intellij.execution.ui.ExecutionConsole)

Aggregations

PythonDebugLanguageConsoleView (com.jetbrains.python.console.PythonDebugLanguageConsoleView)5 ExecutionConsole (com.intellij.execution.ui.ExecutionConsole)3 RunnerLayoutUi (com.intellij.execution.ui.RunnerLayoutUi)2 Content (com.intellij.ui.content.Content)2 NotNull (org.jetbrains.annotations.NotNull)2 ProcessHandler (com.intellij.execution.process.ProcessHandler)1 SMTRunnerConsoleView (com.intellij.execution.testframework.sm.runner.ui.SMTRunnerConsoleView)1 BaseTestsOutputConsoleView (com.intellij.execution.testframework.ui.BaseTestsOutputConsoleView)1 ConsoleView (com.intellij.execution.ui.ConsoleView)1 ContentManager (com.intellij.ui.content.ContentManager)1 XDebugSessionImpl (com.intellij.xdebugger.impl.XDebugSessionImpl)1 XDebugSessionTab (com.intellij.xdebugger.impl.ui.XDebugSessionTab)1 XDebugTabLayouter (com.intellij.xdebugger.ui.XDebugTabLayouter)1