Search in sources :

Example 11 with Breakpoint

use of com.intellij.debugger.ui.breakpoints.Breakpoint in project intellij-community by JetBrains.

the class DebugProcessEvents method getEventText.

public String getEventText(Pair<Breakpoint, Event> descriptor) {
    String text = "";
    final Event event = descriptor.getSecond();
    final Breakpoint breakpoint = descriptor.getFirst();
    if (event instanceof LocatableEvent) {
        try {
            text = breakpoint != null ? breakpoint.getEventMessage(((LocatableEvent) event)) : DebuggerBundle.message("status.generic.breakpoint.reached");
        } catch (InternalException e) {
            text = DebuggerBundle.message("status.generic.breakpoint.reached");
        }
    } else if (event instanceof VMStartEvent) {
        text = DebuggerBundle.message("status.process.started");
    } else if (event instanceof VMDeathEvent) {
        text = DebuggerBundle.message("status.process.terminated");
    } else if (event instanceof VMDisconnectEvent) {
        final RemoteConnection connection = getConnection();
        final String addressDisplayName = DebuggerBundle.getAddressDisplayName(connection);
        final String transportName = DebuggerBundle.getTransportName(connection);
        text = DebuggerBundle.message("status.disconnected", addressDisplayName, transportName);
    }
    return text;
}
Also used : StackCapturingLineBreakpoint(com.intellij.debugger.ui.breakpoints.StackCapturingLineBreakpoint) XBreakpoint(com.intellij.xdebugger.breakpoints.XBreakpoint) Breakpoint(com.intellij.debugger.ui.breakpoints.Breakpoint) RemoteConnection(com.intellij.execution.configurations.RemoteConnection) InternalException(com.sun.jdi.InternalException)

Example 12 with Breakpoint

use of com.intellij.debugger.ui.breakpoints.Breakpoint in project google-cloud-intellij by GoogleCloudPlatform.

the class BreakpointErrorStatusPanel method loadFrom.

@Override
public void loadFrom(@NotNull XLineBreakpoint<CloudLineBreakpointProperties> breakpoint) {
    XBreakpointBase lineBreakpointImpl = breakpoint instanceof XBreakpointBase ? (XBreakpointBase) breakpoint : null;
    Breakpoint javaBreakpoint = BreakpointManager.getJavaBreakpoint(breakpoint);
    CloudLineBreakpoint cloudBreakpoint = null;
    if (javaBreakpoint instanceof CloudLineBreakpoint) {
        cloudBreakpoint = (CloudLineBreakpoint) javaBreakpoint;
    }
    if (cloudBreakpoint == null || lineBreakpointImpl == null) {
        return;
    }
    errorPanel.setVisible(cloudBreakpoint.hasError());
    if (cloudBreakpoint.hasError()) {
        errorLabel.setForeground(JBColor.RED);
        errorDescription.setText(cloudBreakpoint.getErrorMessage());
    }
}
Also used : CloudLineBreakpoint(com.google.cloud.tools.intellij.debugger.CloudLineBreakpointType.CloudLineBreakpoint) XLineBreakpoint(com.intellij.xdebugger.breakpoints.XLineBreakpoint) Breakpoint(com.intellij.debugger.ui.breakpoints.Breakpoint) CloudLineBreakpoint(com.google.cloud.tools.intellij.debugger.CloudLineBreakpointType.CloudLineBreakpoint) XBreakpointBase(com.intellij.xdebugger.impl.breakpoints.XBreakpointBase)

Example 13 with Breakpoint

use of com.intellij.debugger.ui.breakpoints.Breakpoint in project google-cloud-intellij by GoogleCloudPlatform.

the class BreakpointConfigurationPanel method loadFrom.

@Override
public void loadFrom(@NotNull XLineBreakpoint<CloudLineBreakpointProperties> breakpoint) {
    XBreakpointBase lineBreakpointImpl = breakpoint instanceof XBreakpointBase ? (XBreakpointBase) breakpoint : null;
    Breakpoint javaBreakpoint = BreakpointManager.getJavaBreakpoint(breakpoint);
    CloudLineBreakpointType.CloudLineBreakpoint cloudBreakpoint = null;
    if (javaBreakpoint instanceof CloudLineBreakpointType.CloudLineBreakpoint) {
        cloudBreakpoint = (CloudLineBreakpointType.CloudLineBreakpoint) javaBreakpoint;
    }
    if (cloudBreakpoint == null || lineBreakpointImpl == null) {
        return;
    }
    XDebuggerEditorsProvider debuggerEditorsProvider = cloudLineBreakpointType.getEditorsProvider(breakpoint, cloudBreakpoint.getProject());
    if (debuggerEditorsProvider != null) {
        treePanel = new XDebuggerTreePanel(cloudBreakpoint.getProject(), debuggerEditorsProvider, this, breakpoint.getSourcePosition(), "GoogleCloudTools.BreakpointWatchContextMenu", null);
        List<XExpression> watches = new ArrayList<XExpression>();
        for (String watchExpression : breakpoint.getProperties().getWatchExpressions()) {
            watches.add(debuggerEditorsProvider.createExpression(((XBreakpointBase) breakpoint).getProject(), new DocumentImpl(watchExpression), getFileTypeLanguage(breakpoint), EvaluationMode.EXPRESSION));
        }
        rootNode = new WatchesRootNode(treePanel.getTree(), this, watches.toArray(new XExpression[watches.size()]));
        treePanel.getTree().setRoot(rootNode, false);
        watchPanel.removeAll();
        watchPanel.add(watchLabel, BorderLayout.NORTH);
        treePanel.getTree().getEmptyText().setText("There are no custom watches for this snapshot location.");
        final ToolbarDecorator decorator = ToolbarDecorator.createDecorator(treePanel.getTree()).disableUpDownActions();
        decorator.setToolbarPosition(ActionToolbarPosition.RIGHT);
        decorator.setAddAction(new AnActionButtonRunnable() {

            @Override
            public void run(AnActionButton button) {
                executeAction(XDebuggerActions.XNEW_WATCH);
            }
        });
        decorator.setRemoveAction(new AnActionButtonRunnable() {

            @Override
            public void run(AnActionButton button) {
                executeAction(XDebuggerActions.XREMOVE_WATCH);
            }
        });
        CustomLineBorder border = new CustomLineBorder(CaptionPanel.CNT_ACTIVE_BORDER_COLOR, SystemInfo.isMac ? 1 : 0, 0, SystemInfo.isMac ? 0 : 1, 0);
        decorator.setToolbarBorder(border);
        watchPanel.add(decorator.createPanel(), BorderLayout.CENTER);
    }
}
Also used : XLineBreakpoint(com.intellij.xdebugger.breakpoints.XLineBreakpoint) Breakpoint(com.intellij.debugger.ui.breakpoints.Breakpoint) AnActionButtonRunnable(com.intellij.ui.AnActionButtonRunnable) XBreakpointBase(com.intellij.xdebugger.impl.breakpoints.XBreakpointBase) XDebuggerTreePanel(com.intellij.xdebugger.impl.ui.tree.XDebuggerTreePanel) ArrayList(java.util.ArrayList) XDebuggerEditorsProvider(com.intellij.xdebugger.evaluation.XDebuggerEditorsProvider) DocumentImpl(com.intellij.openapi.editor.impl.DocumentImpl) AnActionButton(com.intellij.ui.AnActionButton) CustomLineBorder(com.intellij.ui.border.CustomLineBorder) WatchesRootNode(com.intellij.xdebugger.impl.ui.tree.nodes.WatchesRootNode) ToolbarDecorator(com.intellij.ui.ToolbarDecorator) XExpression(com.intellij.xdebugger.XExpression) CloudLineBreakpointType(com.google.cloud.tools.intellij.debugger.CloudLineBreakpointType)

Aggregations

Breakpoint (com.intellij.debugger.ui.breakpoints.Breakpoint)13 DebuggerManagerEx (com.intellij.debugger.DebuggerManagerEx)4 BreakpointManager (com.intellij.debugger.ui.breakpoints.BreakpointManager)4 XBreakpoint (com.intellij.xdebugger.breakpoints.XBreakpoint)4 StackCapturingLineBreakpoint (com.intellij.debugger.ui.breakpoints.StackCapturingLineBreakpoint)3 Project (com.intellij.openapi.project.Project)3 SourcePosition (com.intellij.debugger.SourcePosition)2 LocatableEventRequestor (com.intellij.debugger.engine.requests.LocatableEventRequestor)2 Requestor (com.intellij.debugger.requests.Requestor)2 FieldBreakpoint (com.intellij.debugger.ui.breakpoints.FieldBreakpoint)2 Document (com.intellij.openapi.editor.Document)2 XDebugSession (com.intellij.xdebugger.XDebugSession)2 XLineBreakpoint (com.intellij.xdebugger.breakpoints.XLineBreakpoint)2 XBreakpointBase (com.intellij.xdebugger.impl.breakpoints.XBreakpointBase)2 InternalException (com.sun.jdi.InternalException)2 Event (com.sun.jdi.event.Event)2 Client (com.android.ddmlib.Client)1 InstantRunClient (com.android.tools.fd.client.InstantRunClient)1 InstantRunPushFailedException (com.android.tools.fd.client.InstantRunPushFailedException)1 CloudLineBreakpointType (com.google.cloud.tools.intellij.debugger.CloudLineBreakpointType)1