XDebugger: @Nullable XBreakpoint.getProperties()

This commit is contained in:
Anton Makeev
2013-09-19 17:11:47 +02:00
parent faa22da18a
commit e875e65a73
2 changed files with 22 additions and 10 deletions
@@ -544,16 +544,22 @@ public class PyDebugProcess extends XDebugProcess implements IPyDebugProcess, Pr
}
public void addExceptionBreakpoint(XBreakpoint<? extends ExceptionBreakpointProperties> breakpoint) {
myRegisteredExceptionBreakpoints.put(breakpoint.getProperties().getException(), breakpoint);
ExceptionBreakpointProperties properties = breakpoint.getProperties();
if (properties == null) return;
myRegisteredExceptionBreakpoints.put(properties.getException(), breakpoint);
if (isConnected()) {
myDebugger.addExceptionBreakpoint(breakpoint.getProperties());
myDebugger.addExceptionBreakpoint(properties);
}
}
public void removeExceptionBreakpoint(XBreakpoint<? extends ExceptionBreakpointProperties> breakpoint) {
myRegisteredExceptionBreakpoints.remove(breakpoint.getProperties().getException());
ExceptionBreakpointProperties properties = breakpoint.getProperties();
if (properties == null) return;
myRegisteredExceptionBreakpoints.remove(properties.getException());
if (isConnected()) {
myDebugger.removeExceptionBreakpoint(breakpoint.getProperties());
myDebugger.removeExceptionBreakpoint(properties);
}
}
@@ -225,18 +225,24 @@ public class PyExceptionBreakpointType
@Override
public void saveTo(@NotNull XBreakpoint<PyExceptionBreakpointProperties> breakpoint) {
breakpoint.getProperties().setNotifyOnTerminate(myNotifyOnTerminateCheckBox.isSelected());
PyExceptionBreakpointProperties properties = breakpoint.getProperties();
if (properties == null) return;
properties.setNotifyOnTerminate(myNotifyOnTerminateCheckBox.isSelected());
breakpoint.getProperties().setNotifyAlways(myNotifyOnRaiseCheckBox.isSelected() && myAlwaysRadio.isSelected());
breakpoint.getProperties().setNotifyOnlyOnFirst(myNotifyOnRaiseCheckBox.isSelected() && myOnlyOnFirstRadio.isSelected());
properties.setNotifyAlways(myNotifyOnRaiseCheckBox.isSelected() && myAlwaysRadio.isSelected());
properties.setNotifyOnlyOnFirst(myNotifyOnRaiseCheckBox.isSelected() && myOnlyOnFirstRadio.isSelected());
}
@Override
public void loadFrom(@NotNull XBreakpoint<PyExceptionBreakpointProperties> breakpoint) {
myNotifyOnTerminateCheckBox.setSelected(breakpoint.getProperties().isNotifyOnTerminate());
PyExceptionBreakpointProperties properties = breakpoint.getProperties();
if (properties == null) return;
myNotifyOnTerminateCheckBox.setSelected(properties.isNotifyOnTerminate());
boolean always = breakpoint.getProperties().isNotifyAlways();
boolean onFirst = breakpoint.getProperties().isNotifyOnlyOnFirst();
boolean always = properties.isNotifyAlways();
boolean onFirst = properties.isNotifyOnlyOnFirst();
setNotifyOnRaiseSelected(always || onFirst);