use of com.intellij.xdebugger.ui.XDebugTabLayouter in project intellij-community by JetBrains.
the class PyEduDebugProcess method createTabLayouter.
@NotNull
@Override
public XDebugTabLayouter createTabLayouter() {
return new XDebugTabLayouter() {
@NotNull
@Override
public Content registerConsoleContent(@NotNull RunnerLayoutUi ui, @NotNull ExecutionConsole console) {
final PythonDebugLanguageConsoleView view = ((PythonDebugLanguageConsoleView) console);
view.initialized();
view.enableConsole(false);
Content eduConsole = ui.createContent("EduConsole", view.getComponent(), XDebuggerBundle.message("debugger.session.tab.console.content.name"), AllIcons.Debugger.ToolConsole, view.getPreferredFocusableComponent());
eduConsole.setCloseable(false);
ui.addContent(eduConsole, 0, PlaceInGrid.right, false);
return eduConsole;
}
};
}
use of com.intellij.xdebugger.ui.XDebugTabLayouter in project intellij-community by JetBrains.
the class JavaDebugProcess method createTabLayouter.
@NotNull
@Override
public XDebugTabLayouter createTabLayouter() {
return new XDebugTabLayouter() {
@Override
public void registerAdditionalContent(@NotNull RunnerLayoutUi ui) {
registerThreadsPanel(ui);
registerMemoryViewPanel(ui);
}
@NotNull
@Override
public Content registerConsoleContent(@NotNull RunnerLayoutUi ui, @NotNull ExecutionConsole console) {
Content content = null;
if (console instanceof ExecutionConsoleEx) {
((ExecutionConsoleEx) console).buildUi(ui);
content = ui.findContent(DebuggerContentInfo.CONSOLE_CONTENT);
}
if (content == null) {
content = super.registerConsoleContent(ui, console);
}
return content;
}
private void registerThreadsPanel(@NotNull RunnerLayoutUi ui) {
final ThreadsPanel panel = new ThreadsPanel(myJavaSession.getProject(), getDebuggerStateManager());
final Content threadsContent = ui.createContent(DebuggerContentInfo.THREADS_CONTENT, panel, XDebuggerBundle.message("debugger.session.tab.threads.title"), AllIcons.Debugger.Threads, null);
Disposer.register(threadsContent, panel);
threadsContent.setCloseable(false);
ui.addContent(threadsContent, 0, PlaceInGrid.left, true);
ui.addListener(new ContentManagerAdapter() {
@Override
public void selectionChanged(ContentManagerEvent event) {
if (event.getContent() == threadsContent) {
if (threadsContent.isSelected()) {
panel.setUpdateEnabled(true);
if (panel.isRefreshNeeded()) {
panel.rebuildIfVisible(DebuggerSession.Event.CONTEXT);
}
} else {
panel.setUpdateEnabled(false);
}
}
}
}, threadsContent);
}
private void registerMemoryViewPanel(@NotNull RunnerLayoutUi ui) {
final XDebugSession session = getSession();
final DebugProcessImpl process = myJavaSession.getProcess();
final InstancesTracker tracker = InstancesTracker.getInstance(myJavaSession.getProject());
final ClassesFilteredView classesFilteredView = new ClassesFilteredView(session, process, tracker);
final Content memoryViewContent = ui.createContent(MemoryViewManager.MEMORY_VIEW_CONTENT, classesFilteredView, "Memory View", AllIcons.Debugger.MemoryView.Active, null);
memoryViewContent.setCloseable(false);
memoryViewContent.setPinned(true);
memoryViewContent.setShouldDisposeContent(true);
final MemoryViewDebugProcessData data = new MemoryViewDebugProcessData(classesFilteredView);
process.putUserData(MemoryViewDebugProcessData.KEY, data);
ui.addListener(new ContentManagerAdapter() {
@Override
public void contentAdded(ContentManagerEvent event) {
changeMemoryViewMode(event);
}
@Override
public void contentRemoved(ContentManagerEvent event) {
changeMemoryViewMode(event);
}
@Override
public void selectionChanged(ContentManagerEvent event) {
changeMemoryViewMode(event);
}
private void changeMemoryViewMode(@Nullable ContentManagerEvent event) {
if (event != null && event.getContent() == memoryViewContent) {
final ContentManagerEvent.ContentOperation operation = event.getOperation();
final boolean isAddOperation = operation.equals(ContentManagerEvent.ContentOperation.add);
if (isAddOperation || operation.equals(ContentManagerEvent.ContentOperation.remove)) {
classesFilteredView.setActive(isAddOperation, process.getManagerThread());
}
}
}
}, classesFilteredView);
ui.addContent(memoryViewContent, 0, PlaceInGrid.right, true);
}
};
}
use of com.intellij.xdebugger.ui.XDebugTabLayouter 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);
}
}
Aggregations