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

propagates previous change

refs 2553
parent d8c54be5
No related branches found
No related tags found
No related merge requests found
......@@ -23,10 +23,6 @@ import java.util.ArrayList;
import java.util.List;
import java.util.function.Function;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.Status;
import org.eclipse.core.runtime.jobs.Job;
import org.eclipse.emf.ecore.EObject;
import org.eclipse.jface.viewers.ColumnLabelProvider;
import org.eclipse.swt.SWT;
......@@ -42,7 +38,6 @@ import org.fortiss.tooling.kernel.model.constraints.IConstraint;
import org.fortiss.tooling.kernel.model.constraints.IConstraintVerificationStatus;
import org.fortiss.tooling.kernel.model.constraints.OutdatedVerificationStatus;
import org.fortiss.tooling.kernel.model.constraints.SuccessVerificationStatus;
import org.fortiss.tooling.kernel.service.IConstraintVerificationService;
import org.fortiss.tooling.kernel.ui.service.IConstraintVerificationUIService;
import org.fortiss.tooling.kernel.utils.EcoreUtils;
......@@ -52,7 +47,7 @@ import org.fortiss.tooling.kernel.utils.EcoreUtils;
* @author aravantinos
* @author $Author$
* @version $Rev$
* @ConQAT.Rating YELLOW Hash: BC06655274768325481A442F27DF78E6
* @ConQAT.Rating YELLOW Hash: F48102908A93855DE8F4A1B613C51132
*/
public class ConstraintsUIUtils {
......@@ -265,30 +260,4 @@ public class ConstraintsUIUtils {
return ConstraintsUIUtils.getColor(cstr);
}
}
/**
* @param c
* @param value
* Sets the <code>autoCheck</code> field of <code>c</code> to <code>value</code>
* <b>and triggers the verification of <code>c</code> if <code>value</code> is
* <code>true</code>.</b>
* Use this instead of directly setting <code>autocheck</code>.
*/
public static void setAutoCheck(IConstraint c, boolean value) {
c.setAutoCheck(value);
if(value) {
Display display = Display.getDefault();
Job job = new Job("Constraint verification job") {
@Override
protected IStatus run(IProgressMonitor monitor) {
synchronized(c) {
IConstraintVerificationService.getInstance().verify(c);
}
display.asyncExec(() -> ConstraintsUIUtils.triggerMarkersRefresh(c));
return Status.OK_STATUS;
}
};
job.schedule();
}
}
}
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