use of org.eclipse.che.ide.ext.java.client.editor.ProblemRequester in project che by eclipse.
the class PomReconcilingStrategy method doReconcile.
private void doReconcile(final List<Problem> problems) {
if (this.annotationModel == null) {
return;
}
ProblemRequester problemRequester;
if (this.annotationModel instanceof ProblemRequester) {
problemRequester = (ProblemRequester) this.annotationModel;
problemRequester.beginReporting();
} else {
editor.setErrorState(EditorWithErrors.EditorState.NONE);
return;
}
try {
boolean error = false;
boolean warning = false;
for (Problem problem : problems) {
if (!error) {
error = problem.isError();
}
if (!warning) {
warning = problem.isWarning();
}
problemRequester.acceptProblem(problem);
}
if (error) {
editor.setErrorState(EditorWithErrors.EditorState.ERROR);
} else if (warning) {
editor.setErrorState(EditorWithErrors.EditorState.WARNING);
} else {
editor.setErrorState(EditorWithErrors.EditorState.NONE);
}
} catch (final Exception e) {
Log.error(getClass(), e);
} finally {
problemRequester.endReporting();
}
}
Aggregations