Accessing UI Thread [message #492107] |
Sun, 18 October 2009 18:59 |
No real name Messages: 16 Registered: September 2009 |
Junior Member |
|
|
Hello all!
I'm attempting to do an IDocument.replace (..) without getting a SWT access error. I have this code:
///........RunnableStaticDeclaration
public void run(IProgressMonitor monitor)
throws InvocationTargetException, InterruptedException {
// TODO Auto-generated method stub
indents = null;
result = doIndentHelper(offset,length,doc,i0,monitor,indents);
}
///......Later on
final RunnableStatic runnable = new RunnableStatic (offset,length,i0,doc);
//calculating indents
Display.getDefault().syncExec(new Runnable () {
public void run() {
result = runnable.start();
}
});
However, I get SWTAccessErrors. It points me out to the doIndentHelper function where I do a doc.replace(...) where doc is an IDocument. True, this error should occur if I wasn't running in a UI threa, but doesn't syncExec run all code which the runnable calls in a UI thread?
|
|
|
|
Powered by
FUDForum. Page generated in 0.04391 seconds