|
|
|
|
|
Re: [EVL] replace automated messages with mine [message #1691058 is a reply to message #716094] |
Wed, 01 April 2015 22:55 |
|
Hello there,
I was just working on this issue and it turns out that all the validation results are included in the object under the private static void validate(DiagramEditPart diagramEditPart, View view)in the ValidateAction class.
Now diagnostics related with the GMF editor have a code attribute with the value of 1 while errors from the EVL validator have a code of 0 (e.g diagnostics.getChildren().get(0).getCode())
I tried to modify the list but it is unmodifiable. So diagnostics can not change and you can not instantiate a Diagnostic object either!!
So I came up with a dirty solution of modifying the private static void createMarkers(IFile target, Diagnostic emfValidationStatus, DiagramEditPart diagramEditPart)
and the
private static Set<EObject> collectTargetElements(Diagnostic diagnostic, Set<EObject> targetElementCollector, List allDiagnostics)
In the first locate the List data = nextDiagnostic.getData(); and replace it with the following
List data = null;
if(nextDiagnostic.getCode() == 0){
data = nextDiagnostic.getData();
}
In the second method locate the
collectTargetElements((Diagnostic) it.next(), targetElementCollector, allDiagnostics);
and replace it the following:
Diagnostic p = (Diagnostic) it.next();
if (p.getCode() == 0 && it.hasNext()) {
collectTargetElements((Diagnostic) it.next(), targetElementCollector, allDiagnostics);
}
Hope it is useful.
[Updated on: Sat, 18 April 2015 13:43] Report message to a moderator
|
|
|
|
Powered by
FUDForum. Page generated in 0.02986 seconds