Search in sources :

Example 71 with Content

use of com.intellij.ui.content.Content in project intellij-community by JetBrains.

the class GridCellImpl method saveUiState.

public void saveUiState() {
    saveProportions();
    for (Content each : myContents.getKeys()) {
        saveState(each, false);
    }
    for (Content each : myMinimizedContents) {
        saveState(each, true);
    }
    final DimensionService service = DimensionService.getInstance();
    final Dimension size = myContext.getContentManager().getComponent().getSize();
    service.setSize(getDimensionKey(), size, myContext.getProject());
    if (myContext.getWindow() != 0) {
        final Window frame = SwingUtilities.getWindowAncestor(myPlaceholder);
        if (frame != null) {
            service.setLocation(getDimensionKey(), frame.getLocationOnScreen());
        }
    }
}
Also used : Content(com.intellij.ui.content.Content) DimensionService(com.intellij.openapi.util.DimensionService)

Example 72 with Content

use of com.intellij.ui.content.Content in project intellij-community by JetBrains.

the class GridCellImpl method minimize.

public void minimize(Content[] contents) {
    if (contents.length == 0)
        return;
    myContext.saveUiState();
    for (final Content each : contents) {
        myMinimizedContents.add(each);
        remove(each);
        boolean isShowing = myTabs.getComponent().getRootPane() != null;
        updateSelection(isShowing);
        myContainer.minimize(each, new CellTransform.Restore() {

            @Override
            public ActionCallback restoreInGrid() {
                return restore(each);
            }
        });
    }
}
Also used : ActionCallback(com.intellij.openapi.util.ActionCallback) Content(com.intellij.ui.content.Content)

Example 73 with Content

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

Example 74 with Content

use of com.intellij.ui.content.Content in project intellij-community by JetBrains.

the class ProjectViewImpl method removeProjectPane.

@Override
public synchronized void removeProjectPane(@NotNull AbstractProjectViewPane pane) {
    ApplicationManager.getApplication().assertIsDispatchThread();
    myUninitializedPanes.remove(pane);
    //assume we are completely initialized here
    String idToRemove = pane.getId();
    if (!myId2Pane.containsKey(idToRemove))
        return;
    pane.removeTreeChangeListener();
    for (int i = getContentManager().getContentCount() - 1; i >= 0; i--) {
        Content content = getContentManager().getContent(i);
        String id = content != null ? content.getUserData(ID_KEY) : null;
        if (id != null && id.equals(idToRemove)) {
            getContentManager().removeContent(content, true);
        }
    }
    myId2Pane.remove(idToRemove);
    mySelectInTargets.remove(idToRemove);
    viewSelectionChanged();
}
Also used : Content(com.intellij.ui.content.Content)

Example 75 with Content

use of com.intellij.ui.content.Content in project intellij-community by JetBrains.

the class ShowModuleDependenciesAction method actionPerformed.

@Override
public void actionPerformed(@NotNull AnActionEvent e) {
    Project project = e.getProject();
    if (project == null)
        return;
    Module[] modules = LangDataKeys.MODULE_CONTEXT_ARRAY.getData(e.getDataContext());
    if (modules == null) {
        PsiElement element = CommonDataKeys.PSI_FILE.getData(e.getDataContext());
        Module module = element != null ? ModuleUtilCore.findModuleForPsiElement(element) : null;
        if (module != null && ModuleManager.getInstance(project).getModules().length > 1) {
            MyModuleOrProjectScope dlg = new MyModuleOrProjectScope(module.getName());
            if (!dlg.showAndGet()) {
                return;
            }
            if (!dlg.useProjectScope()) {
                modules = new Module[] { module };
            }
        }
    }
    ModulesDependenciesPanel panel = new ModulesDependenciesPanel(project, modules);
    AnalysisScope scope = modules != null ? new AnalysisScope(modules) : new AnalysisScope(project);
    Content content = ContentFactory.SERVICE.getInstance().createContent(panel, scope.getDisplayName(), false);
    content.setDisposer(panel);
    panel.setContent(content);
    DependenciesAnalyzeManager.getInstance(project).addContent(content);
}
Also used : AnalysisScope(com.intellij.analysis.AnalysisScope) Project(com.intellij.openapi.project.Project) Content(com.intellij.ui.content.Content) Module(com.intellij.openapi.module.Module) PsiElement(com.intellij.psi.PsiElement)

Aggregations

Content (com.intellij.ui.content.Content)157 ContentManager (com.intellij.ui.content.ContentManager)42 ToolWindow (com.intellij.openapi.wm.ToolWindow)37 NotNull (org.jetbrains.annotations.NotNull)19 ContentFactory (com.intellij.ui.content.ContentFactory)14 Project (com.intellij.openapi.project.Project)13 Nullable (org.jetbrains.annotations.Nullable)13 MessageView (com.intellij.ui.content.MessageView)10 Disposable (com.intellij.openapi.Disposable)8 ToolWindowManager (com.intellij.openapi.wm.ToolWindowManager)8 RunnerLayoutUi (com.intellij.execution.ui.RunnerLayoutUi)7 ToolWindowManagerEx (com.intellij.openapi.wm.ex.ToolWindowManagerEx)7 ConsoleView (com.intellij.execution.ui.ConsoleView)6 SimpleToolWindowPanel (com.intellij.openapi.ui.SimpleToolWindowPanel)6 TabbedContent (com.intellij.ui.content.TabbedContent)6 DefaultActionGroup (com.intellij.openapi.actionSystem.DefaultActionGroup)5 Ref (com.intellij.openapi.util.Ref)5 ExecutionConsole (com.intellij.execution.ui.ExecutionConsole)4 ToolWindowManagerAdapter (com.intellij.openapi.wm.ex.ToolWindowManagerAdapter)4 Assert.assertNotNull (junit.framework.Assert.assertNotNull)4