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;
}
Aggregations