Hello
I have some code that runs in an org.eclipse.core.runtime.jobs.Job subclass.
@Override
protected IStatus run(IProgressMonitor monitor) {
try {
exec.executeCommands(new EclipseProgressMonitorAdapter(monitor));
final DispatcherScriptOutput output = exec.getDispatcherOutput();
// show results in a dialog.
Display.getDefault().syncExec(new Runnable() {
public void run() {
Dialog d = new SBMLConversionFailureDialog(Display.getDefault().getActiveShell(), output);
d.open();
}
});
I.e., this code is executed in a background thread, and pops up a report Dialog when it is finished.
But, the dialog shell is not detected by SWTBot
E.g., in my test:
bot.waitUntil(new ShellIsActive(SBMLConversionFailureDialog.TITLE),20000);
If I run the job in the UI thread( i.e., not in a background job) the test works fine.
Is there a way to detect a shell launched from a non UI thread?
Many thanks
Richard