use of org.eclipse.mylyn.wikitext.validation.ValidationProblem.Severity in project mylyn.docs by eclipse.
the class TestMarkupValidationRule method findProblem.
@Override
public ValidationProblem findProblem(String markup, int offset, int length) {
Matcher matcher = pattern.matcher(markup);
if (offset > 0 || length != markup.length()) {
matcher.region(offset, offset + length);
}
if (matcher.find()) {
String group = matcher.group(1);
Severity severity;
if ("ERROR".equals(group)) {
severity = Severity.ERROR;
} else {
severity = Severity.WARNING;
}
return new ValidationProblem(severity, "test error", matcher.start(1), matcher.end(1) - matcher.start(1));
}
return null;
}
Aggregations