Search in sources :

Example 6 with ContentManagerEvent

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

Example 7 with ContentManagerEvent

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

Example 8 with ContentManagerEvent

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

Example 9 with ContentManagerEvent

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

Aggregations

ContentManagerEvent (com.intellij.ui.content.ContentManagerEvent)9 ContentManagerAdapter (com.intellij.ui.content.ContentManagerAdapter)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