Executing code from a non-UI thread and then UI thread [message #238599] |
Fri, 21 September 2007 16:39 |
Eclipse User |
|
|
|
Originally posted by: malnatij.lu.unisi.ch
Hi, I have some intensive task that basically computes and fills in a set of data structures.
After setting the data up, I need to show a graphical representation in my plug-in view.
The ModelExtractor extends Job and performs the intensive task.
projectScanner = new ModelExtractor(wantedProject);
System.out.println("ModelExtractor created");
projectScanner.setPriority(Job.LONG);
projectScanner.schedule();
projectScanner.addJobChangeListener(new JobChangeAdapter() {
public void done(IJobChangeEvent event) {
if (event.getResult().isOK()){
System.out.println("ok got");
ViewFiller filler = new ViewFiller(projectScanner,
view,
systemComplexityHandler);
Display.getCurrent().asyncExec(filler);
}
}});
After the ModelExtractor terminates, I need to draw the data, therefore I want to run code in the UI-Thread, using Display.getCurrent().asyncExec().
The problem is that after creating the ViewFiller class (that implements Runnable), its run method is not called by the UI-Thread.
Why?
|
|
|
|
Powered by
FUDForum. Page generated in 0.04099 seconds