private static void createMarkers(IFile target,
Diagnostic emfValidationStatus, DiagramEditPart diagramEditPart) {
if (emfValidationStatus.getSeverity() == Diagnostic.OK) {
return;
}
final Diagnostic rootStatus = emfValidationStatus;
List allDiagnostics = new ArrayList();
DispelDiagramEditorUtil.LazyElement2ViewMap element2ViewMap = new DispelDiagramEditorUtil.LazyElement2ViewMap(
diagramEditPart.getDiagramView(), collectTargetElements(
rootStatus, new HashSet<EObject>(), allDiagnostics));
for (Iterator it = emfValidationStatus.getChildren().iterator(); it
.hasNext();) {
Diagnostic nextDiagnostic = (Diagnostic) it.next();
List data = nextDiagnostic.getData();
if (data != null && !data.isEmpty()
&& data.get(0) instanceof EObject) {
EObject element = (EObject) data.get(0);
View view = DispelDiagramEditorUtil.findView(diagramEditPart,
element, element2ViewMap);
addMarker(
diagramEditPart.getViewer(),
target,
view.eResource().getURIFragment(view),
EMFCoreUtil.getQualifiedName(element, true),
nextDiagnostic.getMessage(),
diagnosticToStatusSeverity(nextDiagnostic.getSeverity()));
}
}
}