mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-18 09:34:34 +07:00
simplified API calls
This commit is contained in:
@@ -130,7 +130,7 @@ public class PositionHighlighter {
|
||||
if(!myIsActive) return;
|
||||
myIsActive = false;
|
||||
if (myHighlighter != null) {
|
||||
myEditor.getMarkupModel().removeHighlighter(myHighlighter);
|
||||
myHighlighter.dispose();
|
||||
myHighlighter = null;
|
||||
}
|
||||
}
|
||||
|
||||
+7
-10
@@ -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();
|
||||
|
||||
+1
-1
@@ -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();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user