Skip to main content



      Home
Home » Language IDEs » Java Development Tools (JDT) » problem with updating TableTreeViewer using IResourceChangeListener
problem with updating TableTreeViewer using IResourceChangeListener [message #153879] Mon, 12 April 2004 21:14 Go to next message
Eclipse UserFriend
Originally posted by: lshan.imail.eecs.berkeley.edu

Hi all eclipse masters,

I have TableTreeViewer to display a tree to reflect the stuff on local file
system. I want that view to be automatically updated when a there is a
change in the resources. Thus, i used IResourceChangeListener. Inside
IResourceChangeListener.resourceChanged(), i remove all the TableTreeItem in
that TableTreeViewer and then search for the new ones, then create
TableTreeItems for them.

The problem occurs when i try to remove all TableTreeItems. I got an
SWTException: "Invalid Thread Access". I found out TableTreeItem is only
allowed to be modified by the thread that created it, but the thread that
invokes IResourceChangeListener.resourceChanged() is not that creating
thread. Therefore, all manipulations inside
IResourceChangeListener.resourceChanged() are disallowed.

How can i solve this problem?? Am i taking the wrong approach?? There must
be a way to solve it.

Thank you very much for all your helps.

Lexin
Re: problem with updating TableTreeViewer using IResourceChangeListener [message #155017 is a reply to message #153879] Mon, 19 April 2004 18:03 Go to previous message
Eclipse UserFriend
Like in Swing in SWT is just one thread listening for user input and
doing all the (re-)drawing. Use Display.(a)syncExec() to execute your
code. You usually obtain that by accessing the current shell.

Sorry, have no Eclipse handy to be more detailed/accurate.

Lexin Shan wrote:

> Hi all eclipse masters,
>
> I have TableTreeViewer to display a tree to reflect the stuff on local file
> system. I want that view to be automatically updated when a there is a
> change in the resources. Thus, i used IResourceChangeListener. Inside
> IResourceChangeListener.resourceChanged(), i remove all the TableTreeItem in
> that TableTreeViewer and then search for the new ones, then create
> TableTreeItems for them.
>
> The problem occurs when i try to remove all TableTreeItems. I got an
> SWTException: "Invalid Thread Access". I found out TableTreeItem is only
> allowed to be modified by the thread that created it, but the thread that
> invokes IResourceChangeListener.resourceChanged() is not that creating
> thread. Therefore, all manipulations inside
> IResourceChangeListener.resourceChanged() are disallowed.
>
> How can i solve this problem?? Am i taking the wrong approach?? There must
> be a way to solve it.
>
> Thank you very much for all your helps.
>
> Lexin
>
>
Previous Topic:Quick class open
Next Topic:Code formatting on check-in/commit and check-out/edit for first time?
Goto Forum:
  


Current Time: Fri May 09 15:05:59 EDT 2025

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

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

Back to the top