use of org.yakindu.sct.model.sgraph.ui.validation.SCTIssue in project statecharts by Yakindu.
the class DefaultResourceChangeToIssueProcessor method removeSCTIssue.
protected void removeSCTIssue(final IMarkerDelta iMarkerDelta, final String elementID) {
final String message = (String) iMarkerDelta.getAttributes().get(IMarker.MESSAGE);
final Iterator<SCTIssue> iterator = currentIssues.get(elementID).iterator();
while (iterator.hasNext()) {
final SCTIssue sctIssue = iterator.next();
if (sctIssue.getMessage().equals(message)) {
iterator.remove();
}
}
changedIssuesElementIDs.add(elementID);
}
use of org.yakindu.sct.model.sgraph.ui.validation.SCTIssue in project statecharts by Yakindu.
the class DefaultValidationIssueStore method processIssues.
@Override
public synchronized void processIssues(List<Issue> issues, IProgressMonitor monitor) {
final Multimap<String, SCTIssue> newVisibleIssues = ArrayListMultimap.create();
for (Issue issue : issues) {
if (issue instanceof SCTIssue) {
String semanticURI = ((SCTIssue) issue).getSemanticURI();
newVisibleIssues.put(semanticURI, (SCTIssue) issue);
}
}
final Multimap<String, SCTIssue> oldVisibleIssues = ArrayListMultimap.create();
synchronized (visibleIssues) {
oldVisibleIssues.putAll(visibleIssues);
// normal and expensive checks will not be executed by the live
// validation, so persistent markers have to be copied
Iterable<SCTIssue> persistentIssues = Iterables.filter(visibleIssues.values(), new Predicate<SCTIssue>() {
public boolean apply(SCTIssue input) {
CheckType type = input.getType();
Severity severity = input.getSeverity();
return CheckType.NORMAL == type || CheckType.EXPENSIVE == type || Severity.INFO == severity;
}
});
for (SCTIssue sctIssue : persistentIssues) {
newVisibleIssues.put(sctIssue.getSemanticURI(), sctIssue);
}
visibleIssues.clear();
visibleIssues.putAll(newVisibleIssues);
}
SetView<String> changes = Sets.symmetricDifference(oldVisibleIssues.keySet(), newVisibleIssues.keySet());
for (String string : changes) {
notifyListeners(string);
}
SetView<String> intersection = Sets.intersection(oldVisibleIssues.keySet(), newVisibleIssues.keySet());
for (String string : intersection) {
if (changedSeverity(string, oldVisibleIssues, newVisibleIssues) || changedErrorCount(string, oldVisibleIssues, newVisibleIssues)) {
notifyListeners(string);
}
}
}
use of org.yakindu.sct.model.sgraph.ui.validation.SCTIssue in project statecharts by Yakindu.
the class DefaultValidationIssueStore method initFromPersistentMarkers.
protected synchronized void initFromPersistentMarkers() {
Multimap<String, SCTIssue> newVisibleIssues = ArrayListMultimap.create();
List<IMarker> markers = getMarkersOfConnectedResource();
for (IMarker iMarker : markers) {
SCTIssue issue = issueCreator.createFromMarker(iMarker, iMarker.getAttribute(SCTMarkerType.SEMANTIC_ELEMENT_ID, ""));
newVisibleIssues.put(issue.getSemanticURI(), issue);
}
synchronized (visibleIssues) {
visibleIssues.clear();
visibleIssues.putAll(newVisibleIssues);
}
notifyListeners();
}