use of com.intellij.xdebugger.impl.breakpoints.XBreakpointBase in project intellij-community by JetBrains.
the class XBreakpointsTestCase method getAllBreakpoints.
protected List<XBreakpoint<?>> getAllBreakpoints() {
final XBreakpointBase<?, ?, ?>[] breakpoints = ApplicationManager.getApplication().runReadAction((Computable<XBreakpointBase<?, ?, ?>[]>) () -> myBreakpointManager.getAllBreakpoints());
final List<XBreakpoint<?>> result = new ArrayList<>();
for (XBreakpointBase<?, ?, ?> breakpoint : breakpoints) {
final XBreakpointType type = breakpoint.getType();
if (type instanceof MySimpleBreakpointType || type instanceof MyLineBreakpointType) {
result.add(breakpoint);
}
}
result.sort((o1, o2) -> StringUtil.compare(((MyBreakpointProperties) o1.getProperties()).myOption, ((MyBreakpointProperties) o2.getProperties()).myOption, true));
return result;
}
use of com.intellij.xdebugger.impl.breakpoints.XBreakpointBase 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());
}
}
use of com.intellij.xdebugger.impl.breakpoints.XBreakpointBase 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);
}
}
Aggregations