Search in sources :

Example 6 with ContentManagerAdapter

use of com.intellij.ui.content.ContentManagerAdapter 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);
}
Also used : RunConfigurationBase(com.intellij.execution.configurations.RunConfigurationBase) ContentManagerAdapter(com.intellij.ui.content.ContentManagerAdapter) ContentManagerEvent(com.intellij.ui.content.ContentManagerEvent)

Example 7 with ContentManagerAdapter

use of com.intellij.ui.content.ContentManagerAdapter 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();
        }
    });
}
Also used : ContentManagerAdapter(com.intellij.ui.content.ContentManagerAdapter) ContentManagerEvent(com.intellij.ui.content.ContentManagerEvent)

Example 8 with ContentManagerAdapter

use of com.intellij.ui.content.ContentManagerAdapter 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;
}
Also used : ToolWindow(com.intellij.openapi.wm.ToolWindow) ContentManagerAdapter(com.intellij.ui.content.ContentManagerAdapter) ContentManagerEvent(com.intellij.ui.content.ContentManagerEvent)

Aggregations

ContentManagerAdapter (com.intellij.ui.content.ContentManagerAdapter)8 ContentManagerEvent (com.intellij.ui.content.ContentManagerEvent)8 RunnerLayoutUi (com.intellij.execution.ui.RunnerLayoutUi)2 ToolWindow (com.intellij.openapi.wm.ToolWindow)2 Content (com.intellij.ui.content.Content)2 ContentManager (com.intellij.ui.content.ContentManager)2 NotNull (org.jetbrains.annotations.NotNull)2 AndroidDebugBridge (com.android.ddmlib.AndroidDebugBridge)1 DeviceContext (com.android.tools.idea.ddms.DeviceContext)1 DevicePanel (com.android.tools.idea.ddms.DevicePanel)1 OpenVmTraceHandler (com.android.tools.idea.ddms.OpenVmTraceHandler)1 AndroidLogcatView (com.android.tools.idea.logcat.AndroidLogcatView)1 InstancesTracker (com.intellij.debugger.memory.component.InstancesTracker)1 MemoryViewDebugProcessData (com.intellij.debugger.memory.component.MemoryViewDebugProcessData)1 ClassesFilteredView (com.intellij.debugger.memory.ui.ClassesFilteredView)1 ThreadsPanel (com.intellij.debugger.ui.impl.ThreadsPanel)1 RunConfigurationBase (com.intellij.execution.configurations.RunConfigurationBase)1 ConsoleView (com.intellij.execution.ui.ConsoleView)1 ExecutionConsole (com.intellij.execution.ui.ExecutionConsole)1 ExecutionConsoleEx (com.intellij.execution.ui.ExecutionConsoleEx)1