From 6671028c1116215babea874a06e63971be59ac7a Mon Sep 17 00:00:00 2001 From: Vincent Aravantinos <aravantinos@fortiss.org> Date: Thu, 14 Apr 2016 09:54:56 +0000 Subject: [PATCH] triggers markers refresh directly in the service after opening status comments refs 2553 --- .../ConstraintVerificationUIService.java | 47 +++++++++++-------- 1 file changed, 27 insertions(+), 20 deletions(-) diff --git a/org.fortiss.tooling.kernel.ui/trunk/src/org/fortiss/tooling/kernel/ui/internal/ConstraintVerificationUIService.java b/org.fortiss.tooling.kernel.ui/trunk/src/org/fortiss/tooling/kernel/ui/internal/ConstraintVerificationUIService.java index df25053fa..2bb8cc03b 100644 --- a/org.fortiss.tooling.kernel.ui/trunk/src/org/fortiss/tooling/kernel/ui/internal/ConstraintVerificationUIService.java +++ b/org.fortiss.tooling.kernel.ui/trunk/src/org/fortiss/tooling/kernel/ui/internal/ConstraintVerificationUIService.java @@ -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 -- GitLab