/** * Returns the XBreakpoint corresponding to the given server breakpoint. * * @param serverBreakpoint the server breakpoint representation * @return the local IDE representation in x-breakpoint form, if enabled */ @Nullable public XBreakpoint getEnabledXBreakpoint(@NotNull Breakpoint serverBreakpoint) { XBreakpoint ideBreakpoint = getXBreakpoint(serverBreakpoint); return (ideBreakpoint == null || !ideBreakpoint.isEnabled()) ? null : ideBreakpoint; }
/** * Returns true if we have a local representation of the snapshot. The snapshot may be pending or * in final state. If in final state, then the local representation will be disabled (not * enabled). The user can re-enable the local state and it will create a new pending snapshot and * de-link the old snapshot from the local representation. * * <p>Snapshots that support more config show a "More..." link in the rightmost column of the * table. */ // todo: is there any feasible way to push this into the breakpoint class itself? // i.e. breakpoint.supportsMoreConfig()? boolean supportsMoreConfig(@Nullable Breakpoint breakpoint) { return process.getBreakpointHandler().getXBreakpoint(breakpoint) != null; }
@Override public void mousePressed(MouseEvent event) { JTable table = (JTable) event.getSource(); Point point = event.getPoint(); Breakpoint breakpoint = getBreakPoint(point); int column = table.columnAtPoint(point); // todo: 4 and 1 here are magic numbers; use named constants for columns; maybe define // in CloudDebuggerTable class if (breakpoint != null && column == 4 && supportsMoreConfig(breakpoint)) { BreakpointsDialogFactory.getInstance(process.getXDebugSession().getProject()) .showDialog(process.getBreakpointHandler().getXBreakpoint(breakpoint)); } else if (event.getClickCount() == 1 && breakpoint != null && table.getSelectedRows().length == 1) { selectSnapshot(breakpoint, false); } } }
public void testRegisterGetAndDelete() { registerMockBreakpoint( psiJavaFile, new String[] {"foowatch1"}, "condition == true", 123, "foo.java", "com.google", false, "b_id"); assertNull(removedBp.get()); assertNotNull(addedBp.get()); assertContainsElements(addedBp.get().getExpressions(), "foowatch1"); assertTrue(addedBp.get().getLocation().getLine() == 124); assertTrue(addedBp.get().getLocation().getPath().equals("com/google/foo.java")); assertTrue(addedBp.get().getCondition().equals("condition == true")); addedBp.get().setId("b_id"); XBreakpoint xideBreakpoint = handler.getXBreakpoint(addedBp.get()); assertNotNull(xideBreakpoint); handler.deleteBreakpoint(addedBp.get()); assertNotNull(removedBp.get()); assertTrue(removedBp.get().equals(addedBp.get().getId())); }