Search in sources :

Example 6 with DebuggerSupport

use of com.intellij.xdebugger.impl.DebuggerSupport in project intellij-community by JetBrains.

the class MuteBreakpointAction method update.

@Override
public void update(@NotNull final AnActionEvent e) {
    super.update(e);
    Project project = e.getData(CommonDataKeys.PROJECT);
    if (project != null) {
        for (DebuggerSupport support : DebuggerSupport.getDebuggerSupports()) {
            DebuggerToggleActionHandler handler = support.getMuteBreakpointsHandler();
            if (handler.isEnabled(project, e)) {
                e.getPresentation().setEnabled(true);
                return;
            }
        }
    }
    e.getPresentation().setEnabled(false);
}
Also used : Project(com.intellij.openapi.project.Project) DebuggerSupport(com.intellij.xdebugger.impl.DebuggerSupport)

Example 7 with DebuggerSupport

use of com.intellij.xdebugger.impl.DebuggerSupport in project intellij-community by JetBrains.

the class BreakpointsFavoriteListProvider method handle.

@Override
public void handle(@NotNull CommonActionsPanel.Buttons type, Project project, @NotNull Set<Object> selectedObjects, JComponent component) {
    Rectangle bounds = component.getBounds();
    if (component instanceof JTree) {
        JTree tree = (JTree) component;
        bounds = tree.getRowBounds(tree.getLeadSelectionRow());
        bounds.y += bounds.height / 2;
        bounds = tree.getVisibleRect().intersection(bounds);
    }
    Point whereToShow = new Point((int) bounds.getCenterX(), (int) bounds.getCenterY());
    switch(type) {
        case EDIT:
            BreakpointItem breakpointItem = (BreakpointItem) ((AbstractTreeNode) selectedObjects.iterator().next()).getValue();
            DebuggerSupport debuggerSupport = XBreakpointUtil.getDebuggerSupport(myProject, breakpointItem);
            if (debuggerSupport == null || breakpointItem == null)
                return;
            debuggerSupport.getEditBreakpointAction().editBreakpoint(myProject, component, whereToShow, breakpointItem);
            break;
        case REMOVE:
            for (Object selectedObject : selectedObjects) {
                BreakpointItem removeBreakpointItem = (BreakpointItem) ((AbstractTreeNode) selectedObject).getValue();
                removeBreakpointItem.removed(myProject);
            }
            break;
        default:
            break;
    }
}
Also used : BreakpointItem(com.intellij.xdebugger.impl.breakpoints.ui.BreakpointItem) DebuggerSupport(com.intellij.xdebugger.impl.DebuggerSupport)

Aggregations

DebuggerSupport (com.intellij.xdebugger.impl.DebuggerSupport)7 Project (com.intellij.openapi.project.Project)2 BreakpointItem (com.intellij.xdebugger.impl.breakpoints.ui.BreakpointItem)2 ArrayList (java.util.ArrayList)2 Presentation (com.intellij.openapi.actionSystem.Presentation)1 Document (com.intellij.openapi.editor.Document)1 Editor (com.intellij.openapi.editor.Editor)1 GutterIconRenderer (com.intellij.openapi.editor.markup.GutterIconRenderer)1 BreakpointPanelProvider (com.intellij.xdebugger.impl.breakpoints.ui.BreakpointPanelProvider)1 NotNull (org.jetbrains.annotations.NotNull)1 Nullable (org.jetbrains.annotations.Nullable)1