use of com.intellij.execution.ui.actions.CloseAction in project intellij-community by JetBrains.
the class PyEduDebugRunner method patchLeftToolbar.
private static void patchLeftToolbar(@NotNull XDebugSession session, @NotNull RunnerLayoutUi ui) {
DefaultActionGroup newLeftToolbar = new DefaultActionGroup();
DefaultActionGroup firstGroup = new DefaultActionGroup();
addActionToGroup(firstGroup, XDebuggerActions.RESUME);
addActionToGroup(firstGroup, IdeActions.ACTION_STOP_PROGRAM);
newLeftToolbar.addAll(firstGroup);
newLeftToolbar.addSeparator();
Executor executor = PyEduDebugExecutor.getInstance();
newLeftToolbar.add(new CloseAction(executor, session.getRunContentDescriptor(), session.getProject()));
//TODO: return proper helpID
newLeftToolbar.add(new ContextHelpAction(executor.getHelpId()));
ui.getOptions().setLeftToolbar(newLeftToolbar, ActionPlaces.DEBUGGER_TOOLBAR);
}
use of com.intellij.execution.ui.actions.CloseAction 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.execution.ui.actions.CloseAction in project intellij-community by JetBrains.
the class RunContentExecutor method createConsole.
private ConsoleView createConsole() {
TextConsoleBuilder consoleBuilder = TextConsoleBuilderFactory.getInstance().createBuilder(myProject);
consoleBuilder.filters(myFilterList);
final ConsoleView console = consoleBuilder.getConsole();
if (myHelpId != null) {
console.setHelpId(myHelpId);
}
Executor executor = DefaultRunExecutor.getRunExecutorInstance();
DefaultActionGroup actions = new DefaultActionGroup();
final JComponent consolePanel = createConsolePanel(console, actions);
RunContentDescriptor descriptor = new RunContentDescriptor(console, myProcess, consolePanel, myTitle);
Disposer.register(descriptor, this);
Disposer.register(descriptor, console);
actions.add(new RerunAction(consolePanel));
actions.add(new StopAction());
actions.add(new CloseAction(executor, descriptor, myProject));
ExecutionManager.getInstance(myProject).getContentManager().showRunContent(executor, descriptor);
if (myActivateToolWindow) {
activateToolWindow();
}
return console;
}
use of com.intellij.execution.ui.actions.CloseAction in project intellij-community by JetBrains.
the class RunIdeConsoleAction method createConsoleView.
@NotNull
private static RunContentDescriptor createConsoleView(@NotNull Project project, @NotNull PsiFile psiFile) {
ConsoleView consoleView = TextConsoleBuilderFactory.getInstance().createBuilder(project).getConsole();
DefaultActionGroup toolbarActions = new DefaultActionGroup();
JComponent panel = new JPanel(new BorderLayout());
panel.add(consoleView.getComponent(), BorderLayout.CENTER);
ActionToolbar toolbar = ActionManager.getInstance().createActionToolbar(ActionPlaces.UNKNOWN, toolbarActions, false);
toolbar.setTargetComponent(consoleView.getComponent());
panel.add(toolbar.getComponent(), BorderLayout.WEST);
final RunContentDescriptor descriptor = new RunContentDescriptor(consoleView, null, panel, psiFile.getName()) {
@Override
public boolean isContentReuseProhibited() {
return true;
}
};
Executor executor = DefaultRunExecutor.getRunExecutorInstance();
toolbarActions.addAll(consoleView.createConsoleActions());
toolbarActions.add(new CloseAction(executor, descriptor, project));
ExecutionManager.getInstance(project).getContentManager().showRunContent(executor, descriptor);
return descriptor;
}
use of com.intellij.execution.ui.actions.CloseAction in project intellij-community by JetBrains.
the class AnalyzeStacktraceUtil method addConsole.
public static RunContentDescriptor addConsole(Project project, @Nullable ConsoleFactory consoleFactory, final String tabTitle, String text, @Nullable Icon icon) {
final TextConsoleBuilder builder = TextConsoleBuilderFactory.getInstance().createBuilder(project);
builder.filters(Extensions.getExtensions(EP_NAME, project));
final ConsoleView consoleView = builder.getConsole();
final DefaultActionGroup toolbarActions = new DefaultActionGroup();
JComponent consoleComponent = consoleFactory != null ? consoleFactory.createConsoleComponent(consoleView, toolbarActions) : new MyConsolePanel(consoleView, toolbarActions);
final RunContentDescriptor descriptor = new RunContentDescriptor(consoleView, null, consoleComponent, tabTitle, icon) {
@Override
public boolean isContentReuseProhibited() {
return true;
}
};
final Executor executor = DefaultRunExecutor.getRunExecutorInstance();
for (AnAction action : consoleView.createConsoleActions()) {
toolbarActions.add(action);
}
final ConsoleViewImpl console = (ConsoleViewImpl) consoleView;
ConsoleViewUtil.enableReplaceActionForConsoleViewEditor(console.getEditor());
console.getEditor().getSettings().setCaretRowShown(true);
toolbarActions.add(new AnnotateStackTraceAction(console.getEditor(), console.getHyperlinks()));
toolbarActions.add(new CloseAction(executor, descriptor, project));
ExecutionManager.getInstance(project).getContentManager().showRunContent(executor, descriptor);
consoleView.allowHeavyFilters();
if (consoleFactory == null) {
printStacktrace(consoleView, text);
}
return descriptor;
}
Aggregations