Search in sources :

Example 11 with ContentFactory

use of com.intellij.ui.content.ContentFactory 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 12 with ContentFactory

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

the class MavenProjectsNavigator method initToolWindow.

private void initToolWindow() {
    initTree();
    JPanel panel = new MavenProjectsNavigatorPanel(myProject, myTree);
    AnAction removeAction = EmptyAction.wrap(ActionManager.getInstance().getAction("Maven.RemoveRunConfiguration"));
    removeAction.registerCustomShortcutSet(CommonShortcuts.getDelete(), myTree, myProject);
    AnAction editSource = EmptyAction.wrap(ActionManager.getInstance().getAction("Maven.EditRunConfiguration"));
    editSource.registerCustomShortcutSet(CommonShortcuts.getEditSource(), myTree, myProject);
    final ToolWindowManagerEx manager = ToolWindowManagerEx.getInstanceEx(myProject);
    myToolWindow = (ToolWindowEx) manager.registerToolWindow(TOOL_WINDOW_ID, false, ToolWindowAnchor.RIGHT, myProject, true);
    myToolWindow.setIcon(MavenIcons.ToolWindowMaven);
    final ContentFactory contentFactory = ServiceManager.getService(ContentFactory.class);
    final Content content = contentFactory.createContent(panel, "", false);
    ContentManager contentManager = myToolWindow.getContentManager();
    contentManager.addContent(content);
    contentManager.setSelectedContent(content, false);
    final ToolWindowManagerAdapter listener = new ToolWindowManagerAdapter() {

        boolean wasVisible = false;

        @Override
        public void stateChanged() {
            if (myToolWindow.isDisposed())
                return;
            boolean visible = myToolWindow.isVisible();
            if (!visible || wasVisible) {
                return;
            }
            scheduleStructureUpdate();
            wasVisible = true;
        }
    };
    manager.addToolWindowManagerListener(listener, myProject);
    ActionManager actionManager = ActionManager.getInstance();
    DefaultActionGroup group = new DefaultActionGroup();
    group.add(actionManager.getAction("Maven.GroupProjects"));
    group.add(actionManager.getAction("Maven.ShowIgnored"));
    group.add(actionManager.getAction("Maven.ShowBasicPhasesOnly"));
    group.add(actionManager.getAction("Maven.AlwaysShowArtifactId"));
    group.add(actionManager.getAction("Maven.ShowVersions"));
    myToolWindow.setAdditionalGearActions(group);
}
Also used : Content(com.intellij.ui.content.Content) ContentManager(com.intellij.ui.content.ContentManager) ToolWindowManagerAdapter(com.intellij.openapi.wm.ex.ToolWindowManagerAdapter) ContentFactory(com.intellij.ui.content.ContentFactory) ToolWindowManagerEx(com.intellij.openapi.wm.ex.ToolWindowManagerEx)

Example 13 with ContentFactory

use of com.intellij.ui.content.ContentFactory 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)13 ContentFactory (com.intellij.ui.content.ContentFactory)13 ContentManager (com.intellij.ui.content.ContentManager)3 DefaultActionGroup (com.intellij.openapi.actionSystem.DefaultActionGroup)2 ToolWindow (com.intellij.openapi.wm.ToolWindow)2 ToolWindowManagerEx (com.intellij.openapi.wm.ex.ToolWindowManagerEx)2 RunnerLayoutUi (com.intellij.execution.ui.RunnerLayoutUi)1 CloseTabToolbarAction (com.intellij.ide.actions.CloseTabToolbarAction)1 AnActionEvent (com.intellij.openapi.actionSystem.AnActionEvent)1 Project (com.intellij.openapi.project.Project)1 ToolWindowManager (com.intellij.openapi.wm.ToolWindowManager)1 ToolWindowManagerAdapter (com.intellij.openapi.wm.ex.ToolWindowManagerAdapter)1 DefaultTreeModel (javax.swing.tree.DefaultTreeModel)1