[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [Newsgroup Home]
[news.eclipse.platform.swt] Re: TableViewer is not Refresh()?

Arunagiri.K schrieb:
Dear All,

I am updating my table viewer content on a background thread. After Thread completion i am refreshing my table viewer through refresh() methodm, but visible area of the tableviewer is not getting refreshed/updated. When we click on the Table row, then immediately it's showing updated values. But unvisible areas in the table viewer is got updated.

Job job = new Job("Updating Items...") {
protected IStatus run(IProgressMonitor monitor) {
try{
 upfateTheModel();
}catch (Exception e) {
 Log.error(e);
}
return Status.OK_STATUS;
}
};
job.setPriority(Job.SHORT);
job.setUser(true);
job.schedule(); // start as soon as possible
job.addJobChangeListener(new JobChangeAdapter() {
public void done(IJobChangeEvent event) {
          tableViewer.refresh();
}
});


I guess you'll get an exception at this point which is logged to the console (but because you are running without the -consoleLog flag you don't see it). You need to make the call to refresh in the UI-Thread using Display#async/syncExec.


Tom
--
B e s t S o l u t i o n . at
--------------------------------------------------------------------
Tom Schindl                                          JFace-Committer
--------------------------------------------------------------------