use of com.google.api.services.clouddebugger.v2.model.Breakpoint in project google-cloud-intellij by GoogleCloudPlatform.
the class CloudDebugHistoricalSnapshots method fireDeleteBreakpoints.
/**
* 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();
}
use of com.google.api.services.clouddebugger.v2.model.Breakpoint in project google-cloud-intellij by GoogleCloudPlatform.
the class CloudDebugHistoricalSnapshots method getSelection.
@VisibleForTesting
int getSelection() {
final List<Breakpoint> breakpointList = process.getCurrentBreakpointList();
int selection = -1;
if (breakpointList != null) {
for (int i = 0; i < breakpointList.size(); i++) {
Breakpoint snapshot = process.getCurrentSnapshot();
if (snapshot != null && breakpointList.get(i).getId().equals(snapshot.getId())) {
selection = i;
break;
}
}
}
return selection;
}
use of com.google.api.services.clouddebugger.v2.model.Breakpoint in project google-cloud-intellij by GoogleCloudPlatform.
the class CloudDebugHistoricalSnapshots method getSelectedBreakpoints.
/**
* Used by delete and clone, this returns the lines the user currently has selected in the
* snapshot list.
*/
@NotNull
private List<Breakpoint> getSelectedBreakpoints() {
List<Breakpoint> selectedBreakpoints = new ArrayList<Breakpoint>();
SnapshotsModel model = (SnapshotsModel) table.getModel();
int[] selectedRows = table.getSelectedRows();
for (int selectedRow : selectedRows) {
selectedBreakpoints.add(model.getBreakpoints().get(selectedRow));
}
return selectedBreakpoints;
}
use of com.google.api.services.clouddebugger.v2.model.Breakpoint in project google-cloud-intellij by GoogleCloudPlatform.
the class SnapshotsModel method getValueAt.
@Override
public Object getValueAt(int rowIndex, int columnIndex) {
if (rowIndex < 0 || rowIndex >= breakpoints.size()) {
return null;
}
Breakpoint breakpoint = breakpoints.get(rowIndex);
switch(columnIndex) {
case 0:
if (breakpoint.getStatus() != null && Boolean.TRUE.equals(breakpoint.getStatus().getIsError())) {
return GoogleCloudToolsIcons.CLOUD_BREAKPOINT_ERROR;
}
if (!Boolean.TRUE.equals(breakpoint.getIsFinalState())) {
return GoogleCloudToolsIcons.CLOUD_BREAKPOINT_CHECKED;
}
return GoogleCloudToolsIcons.CLOUD_BREAKPOINT_FINAL;
case 1:
if (!Boolean.TRUE.equals(breakpoint.getIsFinalState())) {
return GctBundle.getString("clouddebug.pendingstatus");
}
try {
return ISODateTimeFormat.dateTime().parseDateTime(breakpoint.getFinalTime()).toDate();
} catch (IllegalArgumentException iae) {
return new Date();
}
case 2:
String path = breakpoint.getLocation().getPath();
int startIndex = path.lastIndexOf('/');
return path.substring(startIndex >= 0 ? startIndex + 1 : 0) + ":" + breakpoint.getLocation().getLine().toString();
case 3:
return breakpoint.getCondition();
case 4:
if (snapshots.supportsMoreConfig(breakpoint)) {
return GctBundle.getString("clouddebug.moreHTML");
} else {
return null;
}
default:
return null;
}
}
Aggregations