use of com.intellij.debugger.DebuggerManagerEx in project intellij-community by JetBrains.
the class BreakpointsContextProvider method clearContext.
public void clearContext() {
final BreakpointManager breakpointManager = ((DebuggerManagerEx) myDebuggerManager).getBreakpointManager();
List<Breakpoint> breakpoints = breakpointManager.getBreakpoints();
for (final Breakpoint breakpoint : breakpoints) {
ApplicationManager.getApplication().runWriteAction(() -> breakpointManager.removeBreakpoint(breakpoint));
}
}
use of com.intellij.debugger.DebuggerManagerEx in project intellij-community by JetBrains.
the class ToggleFieldBreakpointAction method actionPerformed.
@Override
public void actionPerformed(AnActionEvent e) {
Project project = e.getData(CommonDataKeys.PROJECT);
if (project == null) {
return;
}
final SourcePosition place = getPlace(e);
if (place != null) {
Document document = PsiDocumentManager.getInstance(project).getDocument(place.getFile());
if (document != null) {
DebuggerManagerEx debuggerManager = DebuggerManagerEx.getInstanceEx(project);
BreakpointManager manager = debuggerManager.getBreakpointManager();
final int offset = place.getOffset();
final Breakpoint breakpoint = offset >= 0 ? manager.findBreakpoint(document, offset, FieldBreakpoint.CATEGORY) : null;
if (breakpoint == null) {
FieldBreakpoint fieldBreakpoint = manager.addFieldBreakpoint(document, offset);
if (fieldBreakpoint != null) {
if (DebuggerAction.isContextView(e)) {
final DebuggerTreeNodeImpl selectedNode = DebuggerAction.getSelectedNode(e.getDataContext());
if (selectedNode != null && selectedNode.getDescriptor() instanceof FieldDescriptorImpl) {
ObjectReference object = ((FieldDescriptorImpl) selectedNode.getDescriptor()).getObject();
if (object != null) {
long id = object.uniqueID();
InstanceFilter[] instanceFilters = new InstanceFilter[] { InstanceFilter.create(Long.toString(id)) };
fieldBreakpoint.setInstanceFilters(instanceFilters);
fieldBreakpoint.setInstanceFiltersEnabled(true);
}
}
}
final Editor editor = CommonDataKeys.EDITOR.getData(e.getDataContext());
if (editor != null) {
manager.editBreakpoint(fieldBreakpoint, editor);
}
}
} else {
manager.removeBreakpoint(breakpoint);
}
}
}
}
use of com.intellij.debugger.DebuggerManagerEx in project intellij-community by JetBrains.
the class JavaAwareTestConsoleProperties method getDebugSession.
@Nullable
public DebuggerSession getDebugSession() {
final DebuggerManagerEx debuggerManager = DebuggerManagerEx.getInstanceEx(getProject());
if (debuggerManager == null)
return null;
final Collection<DebuggerSession> sessions = debuggerManager.getSessions();
for (final DebuggerSession debuggerSession : sessions) {
if (getConsole() == debuggerSession.getProcess().getExecutionResult().getExecutionConsole())
return debuggerSession;
}
return null;
}
use of com.intellij.debugger.DebuggerManagerEx in project intellij-community by JetBrains.
the class HotSwapAction method update.
public void update(AnActionEvent e) {
Project project = e.getProject();
if (project == null) {
e.getPresentation().setEnabled(false);
return;
}
DebuggerManagerEx debuggerManager = DebuggerManagerEx.getInstanceEx(project);
DebuggerSession session = debuggerManager.getContext().getDebuggerSession();
e.getPresentation().setEnabled(session != null && HotSwapUIImpl.canHotSwap(session));
}
use of com.intellij.debugger.DebuggerManagerEx in project intellij-community by JetBrains.
the class HotSwapAction method actionPerformed.
public void actionPerformed(AnActionEvent e) {
Project project = e.getProject();
DebuggerManagerEx debuggerManager = DebuggerManagerEx.getInstanceEx(project);
DebuggerSession session = debuggerManager.getContext().getDebuggerSession();
if (session != null && session.isAttached()) {
HotSwapUI.getInstance(project).reloadChangedClasses(session, DebuggerSettings.getInstance().COMPILE_BEFORE_HOTSWAP);
}
}
Aggregations