use of org.eclipse.wst.validation.internal.operations.LocalizedMessage in project webtools.sourceediting by eclipse.
the class MarkupValidator method checkEmptyTag.
private void checkEmptyTag(IStructuredDocumentRegion structuredDocumentRegion, IReporter reporter) {
if (structuredDocumentRegion.isDeleted()) {
return;
}
// navigate to name
ITextRegionList regions = structuredDocumentRegion.getRegions();
if (regions.size() == 2) {
// missing name region
if ((regions.get(0).getType() == DOMRegionContext.XML_TAG_OPEN) && (regions.get(1).getType() == DOMRegionContext.XML_TAG_CLOSE)) {
String messageText = XMLUIMessages.ReconcileStepForMarkup_3;
int start = structuredDocumentRegion.getStartOffset();
int length = structuredDocumentRegion.getLength();
int lineNo = getLineNumber(start);
LocalizedMessage message = new LocalizedMessage(SEVERITY_TAG_NAME_MISSING, messageText);
message.setOffset(start);
message.setLength(length);
message.setLineNo(lineNo);
if (reporter instanceof IncrementalReporter) {
MarkupQuickAssistProcessor processor = new MarkupQuickAssistProcessor();
processor.setProblemId(ProblemIDsXML.EmptyTag);
message.setAttribute(QUICKASSISTPROCESSOR, processor);
AnnotationInfo info = new AnnotationInfo(message);
((IncrementalReporter) reporter).addAnnotationInfo(this, info);
} else {
reporter.addMessage(this, message);
}
}
}
}
Aggregations