Search in sources :

Example 1 with PydevConsoleCommunication

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

the class PyDataView method addTab.

private TabInfo addTab(@NotNull PyFrameAccessor frameAccessor) {
    if (hasOnlyEmptyTab()) {
        myTabs.removeTab(myTabs.getSelectedInfo());
    }
    PyDataViewerPanel panel = new PyDataViewerPanel(myProject, frameAccessor);
    TabInfo info = new TabInfo(panel);
    if (frameAccessor instanceof PydevConsoleCommunication) {
        info.setIcon(PythonIcons.Python.PythonConsole);
        info.setTooltipText("Connected to Python Console");
    }
    if (frameAccessor instanceof PyDebugProcess) {
        info.setIcon(AllIcons.Toolwindows.ToolWindowDebugger);
        String name = ((PyDebugProcess) frameAccessor).getSession().getSessionName();
        info.setTooltipText("Connected to debug session '" + name + "'");
    }
    info.setText(EMPTY_TAB_NAME);
    info.setPreferredFocusableComponent(panel.getSliceTextField());
    info.setActions(new DefaultActionGroup(new NewViewerAction(frameAccessor)), ActionPlaces.UNKNOWN);
    info.setTabLabelActions(new DefaultActionGroup(new CloseViewerAction(info, frameAccessor)), ActionPlaces.UNKNOWN);
    panel.addListener(name -> info.setText(name));
    myTabs.addTab(info);
    myTabs.select(info, true);
    return info;
}
Also used : PydevConsoleCommunication(com.jetbrains.python.console.PydevConsoleCommunication) TabInfo(com.intellij.ui.tabs.TabInfo) PyDebugProcess(com.jetbrains.python.debugger.PyDebugProcess)

Aggregations

TabInfo (com.intellij.ui.tabs.TabInfo)1 PydevConsoleCommunication (com.jetbrains.python.console.PydevConsoleCommunication)1 PyDebugProcess (com.jetbrains.python.debugger.PyDebugProcess)1