Skip to content
Snippets Groups Projects
Commit 6671028c authored by Vincent Aravantinos's avatar Vincent Aravantinos
Browse files

triggers markers refresh directly in the service after opening status

comments
refs 2553
parent bb3fcfea
No related branches found
No related tags found
No related merge requests found
......@@ -36,7 +36,7 @@ import org.fortiss.tooling.kernel.utils.LoggingUtils;
* @author aravantinos
* @author $Author$
* @version $Rev$
* @ConQAT.Rating YELLOW Hash: 220B5753C9EEEF2B9E972690D285AFA9
* @ConQAT.Rating YELLOW Hash: 3F14A57863E8C0447B2BE1CFD412BBDD
*/
public final class ConstraintVerificationUIService extends
EObjectAwareServiceBase<IConstraintVerifierUI<IConstraint>> implements
......@@ -64,6 +64,7 @@ public final class ConstraintVerificationUIService extends
public void openStatus(IConstraintVerificationStatus status) {
IConstraintVerifierUI<IConstraint> verifier = getFirstVerifier(status.getConstraint());
verifier.openStatus(status);
ConstraintsUtils.triggerMarkersRefresh(status.getConstraint());
}
/** {@inheritDoc} */
......@@ -130,27 +131,14 @@ public final class ConstraintVerificationUIService extends
/**
* @param constraint
* @param notification
* If <code>constraint</code> is outdated because its verification status has
* just been changed, we do not want to change the status to outdated...
*/
private boolean skipConstraintSelfNotification(IConstraint constraint,
Notification notification) {
String n = ConstraintsPackage.eINSTANCE.getIConstraint_VerificationStatus().getName();
if(notification.getNotifier() != null && notification.getNotifier().equals(constraint)) {
if(notification.getFeature() instanceof EReference) {
return(n.equals(((ENamedElement)notification.getFeature()).getName()));
}
}
return false;
}
/**
* @param constraint
* @return <code>true</code> if <code>constraint</code> is outdated and has been handled as
* such.
* Checks if <code>notification</code> denotes a change entailing that
* <code>constraint</code> is outdated. If so updates the status to outdated or
* triggers an automatic check if the constraint is {@link IAutoCheck}.
* @return <code>true</code> iff <code>notification</code> indeed entailed that
* <code>constraint</code> is outdated.
*/
private boolean constraintOutdated(IConstraint constraint, Notification notification) {
if(skipConstraintSelfNotification(constraint, notification)) {
if(skipStatusChangeNotification(constraint, notification)) {
return false;
}
if(!IConstraintVerificationService.INSTANCE.isUpToDate(constraint)) {
......@@ -166,11 +154,30 @@ public final class ConstraintVerificationUIService extends
} else if(!(constraint.getVerificationStatus() instanceof OutdatedVerificationStatus)) {
ConstraintsUtils.createOutdatedVerificationStatus(constraint);
}
// Update GUI markers
ConstraintsUtils.triggerMarkersRefresh(constraint);
return true;
}
return false;
}
/**
* @param constraint
* @param notification
* @return true iff <code>notification</code> denotes a change of the
* <code>constraint</code>'s status.
*/
private boolean skipStatusChangeNotification(IConstraint constraint,
Notification notification) {
String n = ConstraintsPackage.eINSTANCE.getIConstraint_VerificationStatus().getName();
if(notification.getNotifier() != null && notification.getNotifier().equals(constraint)) {
if(notification.getFeature() instanceof EReference) {
return(n.equals(((ENamedElement)notification.getFeature()).getName()));
}
}
return false;
}
/**
* @param notification
* @param constrained
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment