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;
}
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);
}
}
}
}
}
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);
}
}
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;
}
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;
}
Aggregations