if (databaseFile == null) {
XDebuggerManager.getInstance(session.getProject()).getBreakpointManager().removeBreakpoint(breakpoint);
} else {
DBSchemaObject object = databaseFile.getObject();
if (object.getConnectionHandler() == connectionHandler) {
DatabaseDebuggerInterface debuggerInterface = connectionHandler.getInterfaceProvider().getDebuggerInterface();
Connection debugConnection = debugProcess.getDebugConnection();
try {
Integer breakpointId = breakpoint.getUserData(BREAKPOINT_ID_KEY);
if (breakpointId != null) {
BreakpointOperationInfo breakpointOperationInfo = debuggerInterface.enableBreakpoint(breakpointId, debugConnection);
String error = breakpointOperationInfo.getError();
if (error != null) {
session.updateBreakpointPresentation( breakpoint,
Icons.DEBUG_INVALID_BREAKPOINT,
"INVALID: " + error);
}
} else {
BreakpointInfo breakpointInfo = debuggerInterface.addBreakpoint(
object.getSchema().getName(),
object.getName(),
object.getObjectType().getName().toUpperCase(),
breakpoint.getLine(),
debugConnection);
String error = breakpointInfo.getError();
if (error != null) {
session.updateBreakpointPresentation( breakpoint,
Icons.DEBUG_INVALID_BREAKPOINT,
"INVALID: " + error);
} else {
breakpoint.putUserData(BREAKPOINT_ID_KEY, breakpointInfo.getBreakpointId());
if (!breakpoint.isEnabled()) {
BreakpointOperationInfo breakpointOperationInfo = debuggerInterface.disableBreakpoint(breakpointInfo.getBreakpointId(), debugConnection);
error = breakpointOperationInfo.getError();
if (error != null) {
session.updateBreakpointPresentation( breakpoint,
Icons.DEBUG_INVALID_BREAKPOINT,
"INVALID: " + error);