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

adds the possibility to choose the delay for autocheck and provides a default...

adds the possibility to choose the delay for autocheck and provides a default dialog to warn about activating potentially consuming checks
refs 2334
parent ac9b2ad6
No related branches found
No related tags found
No related merge requests found
......@@ -244,7 +244,15 @@ public class ConstraintVerifierUIBases {
}
};
// We wait 2s before starting the job because user modifications can go fast
latestJob.schedule(2000);
latestJob.schedule(delayBeforeAutocheck() * 1000);
}
/**
* Delay before autocheck in seconds. Default is 0. For resource-consuming constraints
* should be higher, e.g. 1.
*/
protected int delayBeforeAutocheck() {
return 0;
}
/** {@inheritDoc} */
......@@ -253,20 +261,4 @@ public class ConstraintVerifierUIBases {
return false;
}
}
/**
* Standard warning message to display when a resource-consuming check is activated for the
* first time.
*/
public static void displayTimeConsumptionWarning() {
Display d = Display.getCurrent();
d = d == null ? Display.getDefault() : d;
Shell shell = d.getActiveShell();
String title = "Time/resource-consuming background operation about to start";
String msg = "Activating this check for the first time might consume lots of resources, ";
msg += "this operation will run in the background so that you can still work, but your ";
msg += "system might be slowing down. Note that this is a one-time thing: once the check ";
msg += "is activated, subsequent runs should be unnoticed.";
MessageDialog.openWarning(shell, title, msg);
}
}
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