simplified API calls

This commit is contained in:
Alexey Kudravtsev
2011-02-18 12:04:17 +03:00
parent bcc2a39f8d
commit 74a97e983b
36 changed files with 88 additions and 191 deletions
@@ -130,7 +130,7 @@ public class PositionHighlighter {
if(!myIsActive) return;
myIsActive = false;
if (myHighlighter != null) {
myEditor.getMarkupModel().removeHighlighter(myHighlighter);
myHighlighter.dispose();
myHighlighter = null;
}
}
@@ -112,8 +112,8 @@ public abstract class BreakpointWithHighlighter extends Breakpoint {
}
protected Breakpoint init() {
if(!isValid()) {
getDocument().getMarkupModel(myProject).removeHighlighter(myHighlighter);
if (!isValid()) {
myHighlighter.dispose();
return null;
}
@@ -379,12 +379,9 @@ public abstract class BreakpointWithHighlighter extends Breakpoint {
if (highlighter != null) {
DebuggerInvocationUtil.invokeLater(getProject(), new Runnable() {
public void run() {
if (highlighter.isValid()) {
MarkupModel markupModel = highlighter.getDocument().getMarkupModel(myProject);
markupModel.removeHighlighter(highlighter);
//we should delete it here, so gutter will not fire events to deleted breakpoint
BreakpointWithHighlighter.super.delete();
}
highlighter.dispose();
//we should delete it here, so gutter will not fire events to deleted breakpoint
BreakpointWithHighlighter.super.delete();
}
});
}
@@ -461,13 +458,13 @@ public abstract class BreakpointWithHighlighter extends Breakpoint {
reload();
if(!isValid()) {
oldDocument.getMarkupModel(myProject).removeHighlighter(myHighlighter);
myHighlighter.dispose();
myHighlighter = oldHighlighter;
reload();
return false;
}
oldDocument.getMarkupModel(myProject).removeHighlighter(oldHighlighter);
oldHighlighter.dispose();
DebuggerManagerEx.getInstanceEx(getProject()).getBreakpointManager().fireBreakpointChanged(this);
updateUI();
@@ -56,7 +56,7 @@ public class RunToCursorBreakpoint extends LineBreakpoint {
}
RunToCursorBreakpoint breakpoint = new RunToCursorBreakpoint(project, createHighlighter(project, document, lineIndex), restoreBreakpoints);
document.getMarkupModel(project).removeHighlighter(breakpoint.getHighlighter());
breakpoint.getHighlighter().dispose();
return (RunToCursorBreakpoint)breakpoint.init();
}