TabInfo (@NotNull PyFrameAccessor frameAccessor) { if (hasOnlyEmptyTab()) { myTabs.removeTab(myTabs.getSelectedInfo()); } PyDataViewerPanel panel = null; for (PyDataViewPanelFactory factory : PyDataViewPanelFactory.EP_NAME.getExtensionList()) { panel = factory.createDataViewPanel(myProject, frameAccessor); if (panel != null) break; } if (panel == null) { panel = new PyDataViewerPanel(myProject, frameAccessor); } TabInfo info = new TabInfo(panel); if (frameAccessor instanceof PydevConsoleCommunication) { info.setIcon(PythonIcons.Python.PythonConsole); info.setTooltipText(PyBundle.message("debugger.data.view.connected.to.python.console")); } if (frameAccessor instanceof PyDebugProcess) { info.setIcon(AllIcons.Toolwindows.ToolWindowDebugger); String name = ((PyDebugProcess)frameAccessor).getSession().getSessionName(); info.setTooltipText(PyBundle.message("debugger.data.view.connected.to.debug.session", name)); } info.setText(PyBundle.message("debugger.data.view.empty.tab")); info.setPreferredFocusableComponent(panel.getSliceTextField()); info.setActions(new DefaultActionGroup(new NewViewerAction(frameAccessor)), ActionPlaces.EDITOR_TAB); info.setTabLabelActions(new DefaultActionGroup(new CloseViewerAction(info, frameAccessor)), ActionPlaces.EDITOR_TAB); panel.addListener(name -> info.setText(name)); myTabs.addTab(info); myTabs.select(info, true); return info; }