use of com.intellij.ui.content.ContentManagerEvent in project intellij-community by JetBrains.
the class ProjectViewImpl method setupImpl.
// public for tests
public synchronized void setupImpl(@NotNull ToolWindow toolWindow, final boolean loadPaneExtensions) {
ApplicationManager.getApplication().assertIsDispatchThread();
myActionGroup = new DefaultActionGroup();
myAutoScrollFromSourceHandler.install();
myContentManager = toolWindow.getContentManager();
if (!ApplicationManager.getApplication().isUnitTestMode()) {
toolWindow.setDefaultContentUiType(ToolWindowContentUiType.COMBO);
((ToolWindowEx) toolWindow).setAdditionalGearActions(myActionGroup);
toolWindow.getComponent().putClientProperty(ToolWindowContentUi.HIDE_ID_LABEL, "true");
}
GuiUtils.replaceJSplitPaneWithIDEASplitter(myPanel);
SwingUtilities.invokeLater(() -> splitterProportions.restoreSplitterProportions(myPanel));
if (loadPaneExtensions) {
ensurePanesLoaded();
}
isInitialized = true;
doAddUninitializedPanes();
getContentManager().addContentManagerListener(new ContentManagerAdapter() {
@Override
public void selectionChanged(ContentManagerEvent event) {
if (event.getOperation() == ContentManagerEvent.ContentOperation.add) {
viewSelectionChanged();
}
}
});
viewSelectionChanged();
}
use of com.intellij.ui.content.ContentManagerEvent in project intellij-community by JetBrains.
the class LogConsoleManagerBase method doAddLogConsole.
private void doAddLogConsole(@NotNull final LogConsoleBase log, String id, Icon icon, @Nullable RunProfile runProfile) {
if (runProfile instanceof RunConfigurationBase) {
((RunConfigurationBase) runProfile).customizeLogConsole(log);
}
log.attachStopLogConsoleTrackingListener(getProcessHandler());
addAdditionalTabComponent(log, id, icon);
getUi().addListener(new ContentManagerAdapter() {
@Override
public void selectionChanged(final ContentManagerEvent event) {
log.activate();
}
}, log);
}
use of com.intellij.ui.content.ContentManagerEvent in project intellij-community by JetBrains.
the class PyDataViewToolWindowFactory method addPythonConsoleListener.
private static void addPythonConsoleListener(@NotNull Project project) {
final ToolWindow pythonConsole = ToolWindowManager.getInstance(project).getToolWindow(PythonConsoleToolWindowFactory.Companion.getID());
if (pythonConsole == null) {
return;
}
pythonConsole.getContentManager().addContentManagerListener(new ContentManagerAdapter() {
@Override
public void contentRemoved(ContentManagerEvent event) {
PyDataView.getInstance(project).closeDisconnectedFromConsoleTabs();
}
});
}
use of com.intellij.ui.content.ContentManagerEvent in project azure-tools-for-java by Microsoft.
the class StreamingLogsToolWindowManager method getToolWindow.
private ToolWindow getToolWindow(Project project) {
if (toolWindowMap.containsKey(project)) {
return toolWindowMap.get(project);
}
// Add content manager listener when get tool window at the first time
final ToolWindow toolWindow = ToolWindowManager.getInstance(project).getToolWindow(LOG_TOOL_WINDOW);
toolWindow.getContentManager().addContentManagerListener(new ContentManagerAdapter() {
@Override
public void contentRemoved(ContentManagerEvent contentManagerEvent) {
final String displayName = contentManagerEvent.getContent().getDisplayName();
resourceIdToNameMap.removeValue(displayName);
}
});
toolWindowMap.put(project, toolWindow);
return toolWindow;
}
Aggregations