private static void createMarkers(View target,
Diagnostic emfValidationStatus, DiagramEditPart diagramEditPart) {
if (emfValidationStatus.getSeverity() == Diagnostic.OK) {
return;
}
final Diagnostic rootStatus = emfValidationStatus;
List allDiagnostics = new ArrayList();
OntoUML.diagram.part.OntoUMLDiagramEditorUtil.LazyElement2ViewMap element2ViewMap = new OntoUML.diagram.part.OntoUMLDiagramEditorUtil.LazyElement2ViewMap(
diagramEditPart.getDiagramView(), collectTargetElements(
rootStatus, new HashSet(), 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 = OntoUML.diagram.part.OntoUMLDiagramEditorUtil
.findView(diagramEditPart, element, element2ViewMap);
addMarker(
diagramEditPart.getViewer(),
target,
view.eResource().getURIFragment(view),
EMFCoreUtil.getQualifiedName(element, true),
nextDiagnostic.getMessage(),
diagnosticToStatusSeverity(nextDiagnostic.getSeverity()));
}
}
}