Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Plugin Development Environment (PDE) » Accessing UI Thread(Accessing UI Thread)
Accessing UI Thread [message #492107] Sun, 18 October 2009 18:59 Go to next message
No real name is currently offline No real nameFriend
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?

Re: Accessing UI Thread [message #492205 is a reply to message #492107] Mon, 19 October 2009 13:21 Go to previous message
No real name is currently offline No real nameFriend
Messages: 16
Registered: September 2009
Junior Member
Oh, and all these are static functions, and a static class for the Runnable class. If anyone needs to see more code and more details to help out, please let me know! Thx!
Previous Topic:How to configure headless PDEbuild to build not in the source folder
Next Topic:Accessing UI Thread
Goto Forum:
  


Current Time: Sat Apr 27 02:02:34 GMT 2024

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

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

Back to the top