use of com.intellij.ui.tabs.TabInfo in project intellij-community by JetBrains.
the class PyDataView method updateTabs.
public void updateTabs(@NotNull ProcessHandler handler) {
saveSelectedInfo();
for (TabInfo info : myTabs.getTabs()) {
PyDataViewerPanel panel = getPanel(info);
PyFrameAccessor accessor = panel.getFrameAccessor();
if (!(accessor instanceof PyDebugProcess)) {
continue;
}
boolean shouldBeShown = Comparing.equal(handler, ((PyDebugProcess) accessor).getProcessHandler());
info.setHidden(!shouldBeShown);
}
restoreSelectedInfo(handler);
if (myTabs.getSelectedInfo() == null) {
PyFrameAccessor accessor = getFrameAccessor(handler);
if (accessor != null) {
addTab(accessor);
}
}
}
use of com.intellij.ui.tabs.TabInfo 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;
}
use of com.intellij.ui.tabs.TabInfo in project intellij-community by JetBrains.
the class PyDataView method restoreSelectedInfo.
private void restoreSelectedInfo(@NotNull ProcessHandler handler) {
TabInfo savedSelection = mySelectedInfos.get(handler);
if (savedSelection != null) {
myTabs.select(savedSelection, true);
mySelectedInfos.remove(handler);
}
}
use of com.intellij.ui.tabs.TabInfo in project intellij-community by JetBrains.
the class GridCellImpl method createTabInfoFor.
private TabInfo createTabInfoFor(Content content) {
final TabInfo tabInfo = updatePresentation(new TabInfo(new ProviderWrapper(content, myContext)), content).setObject(content).setPreferredFocusableComponent(content.getPreferredFocusableComponent()).setActionsContextComponent(content.getActionsContextComponent());
myContents.remove(content);
myContents.put(content, tabInfo);
ActionGroup group = (ActionGroup) myContext.getActionManager().getAction(RunnerContentUi.VIEW_TOOLBAR);
tabInfo.setTabLabelActions(group, ViewContext.CELL_TOOLBAR_PLACE);
tabInfo.setDragOutDelegate(((RunnerContentUi) myContext).myDragOutDelegate);
return tabInfo;
}
use of com.intellij.ui.tabs.TabInfo in project intellij-community by JetBrains.
the class GridCellImpl method closeOrMinimize.
public void closeOrMinimize(MouseEvent e) {
TabInfo tabInfo = myTabs.findInfo(e);
if (tabInfo == null)
return;
Content content = getContentFor(tabInfo);
if (CloseViewAction.isEnabled(new Content[] { content })) {
CloseViewAction.perform(myContext, content);
} else if (MinimizeViewAction.isEnabled(myContext, getContents(), ViewContext.CELL_TOOLBAR_PLACE)) {
minimize(content);
}
}
Aggregations