Search in sources :

Example 1 with DebuggerSupport

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

the class XBreakpointUtil method collectPanelProviders.

public static List<BreakpointPanelProvider> collectPanelProviders() {
    List<BreakpointPanelProvider> panelProviders = new ArrayList<>();
    for (DebuggerSupport debuggerSupport : DebuggerSupport.getDebuggerSupports()) {
        panelProviders.add(debuggerSupport.getBreakpointPanelProvider());
    }
    panelProviders.sort((o1, o2) -> o2.getPriority() - o1.getPriority());
    return panelProviders;
}
Also used : ArrayList(java.util.ArrayList) DebuggerSupport(com.intellij.xdebugger.impl.DebuggerSupport) BreakpointPanelProvider(com.intellij.xdebugger.impl.breakpoints.ui.BreakpointPanelProvider)

Example 2 with DebuggerSupport

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

the class XBreakpointUtil method getDebuggerSupport.

@Nullable
public static DebuggerSupport getDebuggerSupport(Project project, BreakpointItem breakpointItem) {
    DebuggerSupport[] debuggerSupports = DebuggerSupport.getDebuggerSupports();
    List<BreakpointItem> items = new ArrayList<>();
    for (DebuggerSupport support : debuggerSupports) {
        support.getBreakpointPanelProvider().provideBreakpointItems(project, items);
        if (items.contains(breakpointItem)) {
            return support;
        }
        items.clear();
    }
    return null;
}
Also used : BreakpointItem(com.intellij.xdebugger.impl.breakpoints.ui.BreakpointItem) ArrayList(java.util.ArrayList) DebuggerSupport(com.intellij.xdebugger.impl.DebuggerSupport) Nullable(org.jetbrains.annotations.Nullable)

Example 3 with DebuggerSupport

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

the class ValueLookupManager method mouseMoved.

@Override
public void mouseMoved(EditorMouseEvent e) {
    if (e.isConsumed()) {
        return;
    }
    Editor editor = e.getEditor();
    if (editor.getProject() != null && editor.getProject() != myProject) {
        return;
    }
    ValueHintType type = AbstractValueHint.getHintType(e);
    if (e.getArea() != EditorMouseEventArea.EDITING_AREA || DISABLE_VALUE_LOOKUP.get(editor) == Boolean.TRUE || type == null) {
        myAlarm.cancelAllRequests();
        return;
    }
    Point point = e.getMouseEvent().getPoint();
    if (myRequest != null && !myRequest.isKeepHint(editor, point)) {
        hideHint();
    }
    for (DebuggerSupport support : mySupports) {
        QuickEvaluateHandler handler = support.getQuickEvaluateHandler();
        if (handler.isEnabled(myProject)) {
            requestHint(handler, editor, point, type);
            break;
        }
    }
}
Also used : Editor(com.intellij.openapi.editor.Editor) DebuggerSupport(com.intellij.xdebugger.impl.DebuggerSupport)

Example 4 with DebuggerSupport

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

the class XBreakpointUtil method findSelectedBreakpoint.

@NotNull
public static Pair<GutterIconRenderer, Object> findSelectedBreakpoint(@NotNull final Project project, @NotNull final Editor editor) {
    int offset = editor.getCaretModel().getOffset();
    Document editorDocument = editor.getDocument();
    DebuggerSupport[] debuggerSupports = DebuggerSupport.getDebuggerSupports();
    for (DebuggerSupport debuggerSupport : debuggerSupports) {
        final BreakpointPanelProvider<?> provider = debuggerSupport.getBreakpointPanelProvider();
        final int textLength = editor.getDocument().getTextLength();
        if (offset > textLength) {
            offset = textLength;
        }
        Object breakpoint = provider.findBreakpoint(project, editorDocument, offset);
        if (breakpoint != null) {
            final GutterIconRenderer iconRenderer = provider.getBreakpointGutterIconRenderer(breakpoint);
            return Pair.create(iconRenderer, breakpoint);
        }
    }
    return Pair.create(null, null);
}
Also used : Document(com.intellij.openapi.editor.Document) DebuggerSupport(com.intellij.xdebugger.impl.DebuggerSupport) GutterIconRenderer(com.intellij.openapi.editor.markup.GutterIconRenderer) NotNull(org.jetbrains.annotations.NotNull)

Example 5 with DebuggerSupport

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

the class MarkObjectAction method update.

@Override
public void update(AnActionEvent event) {
    Project project = event.getData(CommonDataKeys.PROJECT);
    boolean enabled = false;
    Presentation presentation = event.getPresentation();
    boolean hidden = true;
    if (project != null) {
        for (DebuggerSupport support : DebuggerSupport.getDebuggerSupports()) {
            MarkObjectActionHandler handler = support.getMarkObjectHandler();
            hidden &= handler.isHidden(project, event);
            if (handler.isEnabled(project, event)) {
                enabled = true;
                String text;
                if (handler.isMarked(project, event)) {
                    text = ActionsBundle.message("action.Debugger.MarkObject.unmark.text");
                } else {
                    text = ActionsBundle.message("action.Debugger.MarkObject.text");
                }
                presentation.setText(text);
                break;
            }
        }
    }
    presentation.setVisible(!hidden && (!ActionPlaces.isPopupPlace(event.getPlace()) || enabled));
    presentation.setEnabled(enabled);
}
Also used : Project(com.intellij.openapi.project.Project) Presentation(com.intellij.openapi.actionSystem.Presentation) 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