I have a java code that looks like this:
//UI thread
//Some code
Job j = new Job(jobName) {
@Override
public IStatus run(IProgressMonitor monitor) {
try {
//Some code
SomeFunc();
//Some code
return Status.OK_STATUS;
} catch(Exception e) {
}
finally {
}
}
};
j.schedule();
The problem is that the SomeFunc(); must be called from the UI thread.
I’m new to java, so can you please help me with showing the best methods for posting event to UI thread or calling a function of UI thread?
Its worth having a look at the Eclipse Jobs and Background Processing tutorial by Lars Vogel. There are good examples on how to run code on the UI thread from Eclipse Jobs.