Skip to main content

Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » GEF » Executing code from a non-UI thread and then UI thread
Executing code from a non-UI thread and then UI thread [message #238599] Fri, 21 September 2007 16:39 Go to next message
Eclipse UserFriend
Originally posted by:

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.addJobChangeListener(new JobChangeAdapter() {
				public void done(IJobChangeEvent event) {
					if (event.getResult().isOK()){
						System.out.println("ok got");
						ViewFiller filler = new ViewFiller(projectScanner,

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.

Re: Executing code from a non-UI thread and then UI thread [message #242052 is a reply to message #238599] Sun, 30 March 2008 18:34 Go to previous message
Eclipse UserFriend
Originally posted by:

the problem was that Display.getCurrent() returns a null display if this method is called from a non-UI thread, therefore if you need to call it, pass the Display through the cain of calls, from a UI thread to the non-UI one.

ciao :D
Previous Topic:setting the inital palette layout
Next Topic:inline editing
Goto Forum:

Current Time: Tue May 22 00:46:25 GMT 2018

Powered by FUDForum. Page generated in 0.01914 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top