problems refreshing a viewer [message #302567] |
Mon, 24 April 2006 09:42  |
Eclipse User |
|
|
|
Originally posted by: b.tanfara.gmx.net
I've set up two views in my RCP, MessageView and UserView. UserView has
TableViewer for which the model is UserList. When an object is added to
UserList, it throws an event that gets caught by UserContentProvider,
which then refreshes the viewer.
I have tested this and it works (made a button on MessageView which adds a
user to userlist, viewer gets refreshed fine).
The problem is when I schedule a Job in MessageView. MessageView listens
for job finishing, and then tries to add a user to UserList. The code
doesn't get past viewer.refresh() then.
Any help would be appreciated.
Bruno
|
|
|
Re: problems refreshing a viewer [message #302569 is a reply to message #302567] |
Mon, 24 April 2006 10:10  |
Eclipse User |
|
|
|
Originally posted by: merks.ca.ibm.com
This is a multi-part message in MIME format.
--------------020707060204060406020108
Content-Type: text/plain; charset=ISO-8859-15; format=flowed
Content-Transfer-Encoding: 7bit
Bruno,
It sounds like you are likely trying to run UI code somewhere other than
the UI thread. You should do the following if that's the case:
getSite().getShell().getDisplay().asyncExec
(new Runnable()
{
public void run()
{
// Do some UI thing here.
}
});
Bruno wrote:
> I've set up two views in my RCP, MessageView and UserView. UserView
> has TableViewer for which the model is UserList. When an object is
> added to UserList, it throws an event that gets caught by
> UserContentProvider, which then refreshes the viewer.
> I have tested this and it works (made a button on MessageView which
> adds a user to userlist, viewer gets refreshed fine).
>
> The problem is when I schedule a Job in MessageView. MessageView
> listens for job finishing, and then tries to add a user to UserList.
> The code doesn't get past viewer.refresh() then.
>
> Any help would be appreciated.
>
> Bruno
>
--------------020707060204060406020108
Content-Type: text/html; charset=ISO-8859-15
Content-Transfer-Encoding: 8bit
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta content="text/html;charset=ISO-8859-15"
http-equiv="Content-Type">
</head>
<body bgcolor="#ffffff" text="#000000">
Bruno,<br>
<br>
It sounds like you are likely trying to run UI code somewhere other
than the UI thread.
|
|
|
Powered by
FUDForum. Page generated in 0.03697 seconds