Search in sources :

Example 86 with Content

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

the class CaptureEditorLightToolWindowManager method initToolWindow.

@Override
protected void initToolWindow() {
    myToolWindow = ToolWindowManager.getInstance(myProject).registerToolWindow(getManagerName(), false, getAnchor(), myProject, true);
    myToolWindow.setIcon(getIcon());
    if (!ApplicationManager.getApplication().isHeadlessEnvironment()) {
        myToolWindow.getComponent().putClientProperty(ToolWindowContentUi.HIDE_ID_LABEL, "true");
    }
    ((ToolWindowEx) myToolWindow).setTitleActions(createActions());
    initGearActions();
    ContentManager contentManager = myToolWindow.getContentManager();
    Content content = contentManager.getFactory().createContent(getContent(), getToolWindowTitleBarText(), false);
    content.setCloseable(false);
    content.setPreferredFocusableComponent(getFocusedComponent());
    contentManager.addContent(content);
    contentManager.setSelectedContent(content, true);
    myToolWindow.setAvailable(false, null);
}
Also used : ToolWindowEx(com.intellij.openapi.wm.ex.ToolWindowEx) Content(com.intellij.ui.content.Content) ContentManager(com.intellij.ui.content.ContentManager)

Example 87 with Content

use of com.intellij.ui.content.Content in project buck by facebook.

the class BuckToolWindowFactory method createToolWindowContent.

@Override
public void createToolWindowContent(final Project project, ToolWindow toolWindow) {
    toolWindow.setAvailable(true, null);
    toolWindow.setToHideOnEmptyContent(true);
    toolWindow.setIcon(BuckIcons.BUCK_TOOL_WINDOW_ICON);
    RunnerLayoutUi runnerLayoutUi = BuckUIManager.getInstance(project).getLayoutUi(project);
    BuckSettingsProvider.State state = BuckSettingsProvider.getInstance().getState();
    JBTabs myTabs = new JBTabsImpl(project);
    // Debug Console
    if (state.showDebug) {
        Content consoleContent = createConsoleContent(runnerLayoutUi, project);
        myTabs.addTab(new TabInfo(consoleContent.getComponent())).setText("Debug");
    }
    // Build Tree Events
    Content treeViewContent = runnerLayoutUi.createContent(BUILD_OUTPUT_PANEL, createBuildInfoPanel(project), "Build Output", null, null);
    myTabs.addTab(new TabInfo(treeViewContent.getComponent()).setText("Build"));
    Content tabsContent = runnerLayoutUi.createContent(TABS_CONTENT_ID, myTabs.getComponent(), "Buck Tool Tabs", null, null);
    runnerLayoutUi.addContent(tabsContent, 0, PlaceInGrid.center, false);
    runnerLayoutUi.getOptions().setLeftToolbar(getLeftToolbarActions(project), ActionPlaces.UNKNOWN);
    runnerLayoutUi.updateActionsNow();
    final ContentManager contentManager = toolWindow.getContentManager();
    Content content = contentManager.getFactory().createContent(runnerLayoutUi.getComponent(), "", true);
    contentManager.addContent(content);
    updateBuckToolWindowTitle(project);
}
Also used : RunnerLayoutUi(com.intellij.execution.ui.RunnerLayoutUi) JBTabs(com.intellij.ui.tabs.JBTabs) JBTabsImpl(com.intellij.ui.tabs.impl.JBTabsImpl) Content(com.intellij.ui.content.Content) ContentManager(com.intellij.ui.content.ContentManager) BuckSettingsProvider(com.facebook.buck.intellij.ideabuck.config.BuckSettingsProvider) TabInfo(com.intellij.ui.tabs.TabInfo)

Example 88 with Content

use of com.intellij.ui.content.Content in project buck by facebook.

the class BuckToolWindowFactory method createConsoleContent.

private Content createConsoleContent(RunnerLayoutUi layoutUi, Project project) {
    ConsoleView consoleView = BuckUIManager.getInstance(project).getConsoleWindow(project);
    Content consoleWindowContent = layoutUi.createContent(OUTPUT_WINDOW_CONTENT_ID, consoleView.getComponent(), "Output Logs", null, null);
    consoleWindowContent.setCloseable(false);
    return consoleWindowContent;
}
Also used : ConsoleView(com.intellij.execution.ui.ConsoleView) Content(com.intellij.ui.content.Content)

Example 89 with Content

use of com.intellij.ui.content.Content in project AndroidWiFiADB by pedrovgs.

the class AndroidWiFiADBWindow method createToolWindowContent.

private void createToolWindowContent(ToolWindow toolWindow) {
    ContentFactory contentFactory = ContentFactory.SERVICE.getInstance();
    Content content = contentFactory.createContent(toolWindowContent, "", false);
    toolWindow.getContentManager().addContent(content);
}
Also used : Content(com.intellij.ui.content.Content) ContentFactory(com.intellij.ui.content.ContentFactory)

Example 90 with Content

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

the class AssistToolWindowFactory method createToolWindowContent.

@Override
public void createToolWindowContent(@NotNull Project project, @NotNull ToolWindow toolWindow) {
    if (myAssistSidePanel == null) {
        myAssistSidePanel = new AssistSidePanel(myActionId, project);
    }
    ContentFactory contentFactory = ContentFactory.SERVICE.getInstance();
    Content content = contentFactory.createContent(myAssistSidePanel, null, false);
    ContentManager contentManager = toolWindow.getContentManager();
    contentManager.removeAllContents(true);
    contentManager.addContent(content);
    contentManager.setSelectedContent(content);
    toolWindow.show(null);
}
Also used : Content(com.intellij.ui.content.Content) ContentManager(com.intellij.ui.content.ContentManager) ContentFactory(com.intellij.ui.content.ContentFactory)

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