Merge pull request #3907 from JakubValtar/update-status

Update status error/warning when changing the line
This commit is contained in:
Ben Fry
2015-09-29 18:05:58 -04:00
4 changed files with 32 additions and 6 deletions

View File

@@ -167,6 +167,12 @@ public class JavaEditor extends Editor {
public void windowGainedFocus(WindowEvent e) { }
});
textarea.addCaretListener(new CaretListener() {
public void caretUpdate(CaretEvent e) {
errorCheckerService.updateEditorStatus();
}
});
}

View File

@@ -953,13 +953,18 @@ public class ErrorCheckerService {
if (errorMarker != null) {
if (errorMarker.getType() == LineMarker.WARNING) {
editor.statusMessage(errorMarker.getProblem().getMessage(),
EditorStatus.WARNING);
EditorStatus.CURSOR_LINE_WARNING);
} else {
editor.statusMessage(errorMarker.getProblem().getMessage(),
EditorStatus.COMPILER_ERROR);
EditorStatus.CURSOR_LINE_ERROR);
}
} else {
editor.statusEmpty(); // No error, clear the status
switch (editor.getStatusMode()) {
case EditorStatus.CURSOR_LINE_ERROR:
case EditorStatus.CURSOR_LINE_WARNING:
editor.statusEmpty();
break;
}
}
}