Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Standard Widget Toolkit (SWT) » SWTException Invalid thread access
SWTException Invalid thread access [message #439756] Thu, 15 July 2004 19:24 Go to next message
Eclipse UserFriend
Originally posted by: ptiedt.us.ibm.com

Hi All,

I get a SWTException if I try to update my TreeViewer. The content provide
for the Viewer implements a listener interface.
I implemented a Listener that listens work workspace changes and fires
filtered change events using

Platform.run(new ISafeRunnable(){


public void run() {
listener.changeEvent(event);
}
});

Now when I try to access the viewer within the changeEvent method I get
the Error

SWTException: Invalid thread access
at org.eclipse.swt.SWT.erro (SWT.java: 2689)

I read about threading issues but didnt really know how to solve my
problem.

Maybe you can help
thx
Philipp
Re: SWTException Invalid thread access [message #439853 is a reply to message #439756] Mon, 19 July 2004 01:51 Go to previous message
Eric Camden is currently offline Eric CamdenFriend
Messages: 19
Registered: July 2009
Junior Member
You have to run the update from the GUI event dispatch thread. This can be
accomplished via Display.[a]syncExec methods.

ptiedt@us.ibm.com wrote:

> Hi All,

> I get a SWTException if I try to update my TreeViewer. The content provide
> for the Viewer implements a listener interface.
> I implemented a Listener that listens work workspace changes and fires
> filtered change events using

> Platform.run(new ISafeRunnable(){


> public void run() {
> listener.changeEvent(event);
> }
> });

> Now when I try to access the viewer within the changeEvent method I get
> the Error

> SWTException: Invalid thread access
> at org.eclipse.swt.SWT.erro (SWT.java: 2689)

> I read about threading issues but didnt really know how to solve my
> problem.

> Maybe you can help
> thx
> Philipp
Previous Topic:Automatic time controlled click in a GUI.
Next Topic:outline SQL script
Goto Forum:
  


Current Time: Fri Apr 26 00:39:05 GMT 2024

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

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

Back to the top