IResource resource = (IResource) editor.getEditorInput()
.getAdapter(IResource.class);
if (resource != null) {
for (int i = 0; i < breakpoints.length; i++) {
IBreakpoint breakpoint = breakpoints[i];
if (resource.equals(breakpoint.getMarker().getResource())) {
if (((ILineBreakpoint) breakpoint).getLineNumber() == (lineNumber + 1)) {
breakpoint.delete();
return;
}
}
}
String path = ClojureCore.getAsRootClasspathRelativePath((IFile)resource).substring(1);
JDIDebugModel.createStratumBreakpoint(
resource,
"Clojure",
resource.getName(),
path,
null,
lineNumber + 1,
-1,
-1,
0,
true,
null);
} else {
// Do it "the hard way" by using the WorkspaceRoot as the host for our breakpoint
// ... quick analysis seems to indicate it's done this way by the JDT "itself" !
IStorageEditorInput input = (IStorageEditorInput) editor.getEditorInput();
IStorage storage = input.getStorage();
for (int i = 0; i < breakpoints.length; i++) {
IBreakpoint breakpoint = breakpoints[i];
if (breakpoint instanceof IJavaStratumLineBreakpoint) {
IJavaStratumLineBreakpoint stratumBreakpoint = (IJavaStratumLineBreakpoint) breakpoint;
if (storage.getFullPath().toPortableString().equals(stratumBreakpoint.getSourcePath())) {
if (((ILineBreakpoint) breakpoint).getLineNumber() == (lineNumber + 1)) {
breakpoint.delete();
return;
}
}
}
}