@Override public void run() { getBreakpointHandler().createIdeRepresentationsIfNecessary(currentList); } });
@Override public void actionPerformed(AnActionEvent event) { process.getBreakpointHandler().cloneToNewBreakpoints(getSelectedBreakpoints()); } }
/** * 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 run() { getBreakpointHandler().createIdeRepresentationsIfNecessary(getCurrentBreakpointList()); } });
@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); } } }
/** * Deletes breakpoints asynchronously on a threadpool thread. The user will see these breakpoints * gradually disappear. */ private void fireDeleteBreakpoints(@NotNull final List<Breakpoint> breakpointsToDelete) { for (Breakpoint breakpoint : breakpointsToDelete) { getModel().markForDelete(breakpoint.getId()); process.getBreakpointHandler().deleteBreakpoint(breakpoint); } getModel().fireTableDataChanged(); }
@Override public void onSuccess(@NotNull final Breakpoint result) { ApplicationManager.getApplication() .invokeLater( () -> { // We will only do the selection if the id for this async task matches the // latest // user clicked item. This prevents multiple (and possibly out of order) // selections getting queued up. if (id.equals(navigatedSnapshotId)) { if (!Boolean.TRUE.equals(result.getIsFinalState()) || result.getStackFrames() == null) { getBreakpointHandler().navigateTo(result); if (result.getStackFrames() == null) { navigateToBreakpoint(result); } return; } navigateToBreakpoint(result); } }, ModalityState.NON_MODAL); }
final XBreakpoint breakpointHit = getBreakpointHandler().getEnabledXBreakpoint(breakpoint); if (breakpointHit == null) { continue; || !Boolean.TRUE.equals(breakpoint.getStatus().getIsError()))) { if (!getXDebugSession().isStopped()) { getBreakpointHandler().setStateToDisabled(breakpoint);
@Test public void testOnBreakpointListChanged() throws InterruptedException { CloudDebugHistoricalSnapshots snapshots = new CloudDebugHistoricalSnapshots(handler); Breakpoint bp1 = new Breakpoint(); bp1.setId("an ID"); bp1.setFinalTime("2015-08-22T05:23:34.123Z"); bp1.setIsFinalState(true); SourceLocation location = new SourceLocation(); location.setPath("foo/bar/baz"); location.setLine(12); bp1.setLocation(location); List<Breakpoint> breakpoints = new ArrayList<Breakpoint>(); breakpoints.add(bp1); Mockito.when(mockProcess.getCurrentBreakpointList()).thenReturn(breakpoints); Mockito.when(mockProcess.getCurrentSnapshot()).thenReturn(bp1); CloudBreakpointHandler breakpointHandler = Mockito.mock(CloudBreakpointHandler.class); Mockito.when(mockProcess.getBreakpointHandler()).thenReturn(breakpointHandler); runModelSetter(snapshots); Assert.assertEquals(0, snapshots.table.getSelectedRow()); }
Mockito.when(mockProcess.getBreakpointHandler()).thenReturn(breakpointHandler);