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; ...@@ -36,7 +36,7 @@ import org.fortiss.tooling.kernel.utils.LoggingUtils;
* @author aravantinos * @author aravantinos
* @author $Author$ * @author $Author$
* @version $Rev$ * @version $Rev$
* @ConQAT.Rating YELLOW Hash: 220B5753C9EEEF2B9E972690D285AFA9 * @ConQAT.Rating YELLOW Hash: 3F14A57863E8C0447B2BE1CFD412BBDD
*/ */
public final class ConstraintVerificationUIService extends public final class ConstraintVerificationUIService extends
EObjectAwareServiceBase<IConstraintVerifierUI<IConstraint>> implements EObjectAwareServiceBase<IConstraintVerifierUI<IConstraint>> implements
...@@ -64,6 +64,7 @@ public final class ConstraintVerificationUIService extends ...@@ -64,6 +64,7 @@ public final class ConstraintVerificationUIService extends
public void openStatus(IConstraintVerificationStatus status) { public void openStatus(IConstraintVerificationStatus status) {
IConstraintVerifierUI<IConstraint> verifier = getFirstVerifier(status.getConstraint()); IConstraintVerifierUI<IConstraint> verifier = getFirstVerifier(status.getConstraint());
verifier.openStatus(status); verifier.openStatus(status);
ConstraintsUtils.triggerMarkersRefresh(status.getConstraint());
} }
/** {@inheritDoc} */ /** {@inheritDoc} */
...@@ -130,27 +131,14 @@ public final class ConstraintVerificationUIService extends ...@@ -130,27 +131,14 @@ public final class ConstraintVerificationUIService extends
/** /**
* @param constraint * @param constraint
* @param notification * @param notification
* If <code>constraint</code> is outdated because its verification status has * Checks if <code>notification</code> denotes a change entailing that
* just been changed, we do not want to change the status to outdated... * <code>constraint</code> is outdated. If so updates the status to outdated or
*/ * triggers an automatic check if the constraint is {@link IAutoCheck}.
private boolean skipConstraintSelfNotification(IConstraint constraint, * @return <code>true</code> iff <code>notification</code> indeed entailed that
Notification notification) { * <code>constraint</code> is outdated.
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.
*/ */
private boolean constraintOutdated(IConstraint constraint, Notification notification) { private boolean constraintOutdated(IConstraint constraint, Notification notification) {
if(skipConstraintSelfNotification(constraint, notification)) { if(skipStatusChangeNotification(constraint, notification)) {
return false; return false;
} }
if(!IConstraintVerificationService.INSTANCE.isUpToDate(constraint)) { if(!IConstraintVerificationService.INSTANCE.isUpToDate(constraint)) {
...@@ -166,11 +154,30 @@ public final class ConstraintVerificationUIService extends ...@@ -166,11 +154,30 @@ public final class ConstraintVerificationUIService extends
} else if(!(constraint.getVerificationStatus() instanceof OutdatedVerificationStatus)) { } else if(!(constraint.getVerificationStatus() instanceof OutdatedVerificationStatus)) {
ConstraintsUtils.createOutdatedVerificationStatus(constraint); ConstraintsUtils.createOutdatedVerificationStatus(constraint);
} }
// Update GUI markers
ConstraintsUtils.triggerMarkersRefresh(constraint);
return true; return true;
} }
return false; 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 notification
* @param constrained * @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