Search in sources :

Example 31 with Content

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

the class XDebugTabLayouter method registerConsoleContent.

/**
   * Registers tab for the given {@code console}.
   *
   * @param console {@code ExecutionConsole} instance
   * @param ui {@code RunnerLayoutUi} instance
   * @return registered {@code Content} instance
   */
@NotNull
public Content registerConsoleContent(@NotNull RunnerLayoutUi ui, @NotNull ExecutionConsole console) {
    Content content = ui.createContent(DebuggerContentInfo.CONSOLE_CONTENT, console.getComponent(), XDebuggerBundle.message("debugger.session.tab.console.content.name"), AllIcons.Debugger.Console, console.getPreferredFocusableComponent());
    content.setCloseable(false);
    ui.addContent(content, 1, PlaceInGrid.bottom, false);
    return content;
}
Also used : Content(com.intellij.ui.content.Content) NotNull(org.jetbrains.annotations.NotNull)

Example 32 with Content

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

the class XDebugSessionTab method showView.

private static void showView(@NotNull XDebugSessionImpl session, String viewId) {
    XDebugSessionTab tab = session.getSessionTab();
    if (tab != null) {
        tab.toFront(false, null);
        // restore watches tab if minimized
        tab.restoreContent(viewId);
        JComponent component = tab.getUi().getComponent();
        if (component instanceof DataProvider) {
            RunnerContentUi ui = RunnerContentUi.KEY.getData(((DataProvider) component));
            if (ui != null) {
                Content content = ui.findContent(viewId);
                // make sure we make it visible to the user
                if (content != null) {
                    ui.select(content, false);
                }
            }
        }
    }
}
Also used : Content(com.intellij.ui.content.Content) RunnerContentUi(com.intellij.execution.ui.layout.impl.RunnerContentUi)

Example 33 with Content

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

the class XDebugSessionTab method attachToSession.

private void attachToSession(@NotNull XDebugSessionImpl session) {
    for (XDebugView view : myViews.values()) {
        attachViewToSession(session, view);
    }
    XDebugTabLayouter layouter = session.getDebugProcess().createTabLayouter();
    Content consoleContent = layouter.registerConsoleContent(myUi, myConsole);
    attachNotificationTo(consoleContent);
    layouter.registerAdditionalContent(myUi);
    RunContentBuilder.addAdditionalConsoleEditorActions(myConsole, consoleContent);
    if (ApplicationManager.getApplication().isUnitTestMode()) {
        return;
    }
    DefaultActionGroup leftToolbar = new DefaultActionGroup();
    final Executor debugExecutor = DefaultDebugExecutor.getDebugExecutorInstance();
    if (myEnvironment != null) {
        leftToolbar.add(ActionManager.getInstance().getAction(IdeActions.ACTION_RERUN));
        List<AnAction> additionalRestartActions = session.getRestartActions();
        if (!additionalRestartActions.isEmpty()) {
            leftToolbar.addAll(additionalRestartActions);
            leftToolbar.addSeparator();
        }
        leftToolbar.addAll(session.getExtraActions());
    }
    leftToolbar.addAll(getCustomizedActionGroup(XDebuggerActions.TOOL_WINDOW_LEFT_TOOLBAR_GROUP));
    for (AnAction action : session.getExtraStopActions()) {
        leftToolbar.add(action, new Constraints(Anchor.AFTER, IdeActions.ACTION_STOP_PROGRAM));
    }
    //group.addSeparator();
    //addAction(group, DebuggerActions.EXPORT_THREADS);
    leftToolbar.addSeparator();
    leftToolbar.add(myUi.getOptions().getLayoutActions());
    final AnAction[] commonSettings = myUi.getOptions().getSettingsActionsList();
    DefaultActionGroup settings = new DefaultActionGroup(ActionsBundle.message("group.XDebugger.settings.text"), true);
    settings.getTemplatePresentation().setIcon(myUi.getOptions().getSettingsActions().getTemplatePresentation().getIcon());
    settings.addAll(commonSettings);
    leftToolbar.add(settings);
    leftToolbar.addSeparator();
    leftToolbar.add(PinToolwindowTabAction.getPinAction());
    leftToolbar.add(new CloseAction(myEnvironment != null ? myEnvironment.getExecutor() : debugExecutor, myRunContentDescriptor, myProject));
    leftToolbar.add(new ContextHelpAction(debugExecutor.getHelpId()));
    DefaultActionGroup topToolbar = new DefaultActionGroup();
    topToolbar.addAll(getCustomizedActionGroup(XDebuggerActions.TOOL_WINDOW_TOP_TOOLBAR_GROUP));
    session.getDebugProcess().registerAdditionalActions(leftToolbar, topToolbar, settings);
    myUi.getOptions().setLeftToolbar(leftToolbar, ActionPlaces.DEBUGGER_TOOLBAR);
    myUi.getOptions().setTopToolbar(topToolbar, ActionPlaces.DEBUGGER_TOOLBAR);
    if (myEnvironment != null) {
        initLogConsoles(myEnvironment.getRunProfile(), myRunContentDescriptor, myConsole);
    }
}
Also used : DefaultDebugExecutor(com.intellij.execution.executors.DefaultDebugExecutor) Executor(com.intellij.execution.Executor) Content(com.intellij.ui.content.Content) XDebugTabLayouter(com.intellij.xdebugger.ui.XDebugTabLayouter) CloseAction(com.intellij.execution.ui.actions.CloseAction) ContextHelpAction(com.intellij.ide.actions.ContextHelpAction)

Example 34 with Content

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

the class XDebugSessionTab method createVariablesContent.

private Content createVariablesContent(@NotNull XDebugSessionImpl session) {
    XVariablesView variablesView;
    if (myWatchesInVariables) {
        variablesView = myWatchesView = new XWatchesViewImpl(session, myWatchesInVariables);
    } else {
        variablesView = new XVariablesView(session);
    }
    registerView(DebuggerContentInfo.VARIABLES_CONTENT, variablesView);
    Content result = myUi.createContent(DebuggerContentInfo.VARIABLES_CONTENT, variablesView.getPanel(), XDebuggerBundle.message("debugger.session.tab.variables.title"), AllIcons.Debugger.Value, null);
    result.setCloseable(false);
    ActionGroup group = getCustomizedActionGroup(XDebuggerActions.VARIABLES_TREE_TOOLBAR_GROUP);
    result.setActions(group, ActionPlaces.DEBUGGER_TOOLBAR, variablesView.getTree());
    return result;
}
Also used : Content(com.intellij.ui.content.Content)

Example 35 with Content

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

the class XDebugSessionTab method createWatchesContent.

private Content createWatchesContent(@NotNull XDebugSessionImpl session) {
    myWatchesView = new XWatchesViewImpl(session, myWatchesInVariables);
    registerView(DebuggerContentInfo.WATCHES_CONTENT, myWatchesView);
    Content watchesContent = myUi.createContent(DebuggerContentInfo.WATCHES_CONTENT, myWatchesView.getPanel(), XDebuggerBundle.message("debugger.session.tab.watches.title"), AllIcons.Debugger.Watches, null);
    watchesContent.setCloseable(false);
    return watchesContent;
}
Also used : Content(com.intellij.ui.content.Content)

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