Show results at end of job [message #448131] |
Tue, 18 April 2006 19:00 |
Michael Schmidt Messages: 45 Registered: July 2009 |
Member |
|
|
Folks,
I hope someone has the time to provide a little help on this seemingly
basic problem. I've read the Jobs-API tutorial and the D'Anjou et al.
section on jobs, as well as searched the mailing lists before bothering
y'all. I want to display an information dialog at the conclusion of a
job, and I also want to take advantage of the job cancellation feature.
Here are code snippets:
protected final IStatus run(final IProgressMonitor monitor)
ends with
} finally {
Application.dbConn.dbLock.release(); // releases the database lock
sbInfo.append("\n*** End Processing Log.\n"); // A String Buffer log
monitor.done();
showResults(sbInfo.toString()); // Calls the display method - problem!
}
return Status.OK_STATUS;
The showResults method:
protected final void showResults(final String message) {
Display.getDefault().asyncExec(new Runnable() {
public void run() {
DbInfoDialog dbDialog = new DbInfoDialog(Display.getDefault()
.getActiveShell(), message);
dbDialog.create();
dbDialog.open();
}
});
}
This works fine for a default job, but fails to display the results when
setUser(true) is invoked (unless "Run in Background" is clicked before the
job completes). The Jobs-API tutorial indicated that even if the job is
modal, an asyncExec is used to display results. Apparently not?
Michael Schmidt
|
|
|
Powered by
FUDForum. Page generated in 0.06892 seconds