TableViewer Refresh [message #467749] |
Sun, 05 February 2006 23:02 |
Eclipse User |
|
|
|
Originally posted by: jbell80.msn.com
I have a TableViewer in a ViewPart. But the content is being created in a
Job.
Everything runs without error but the content is not displayed when the
Job completes. If I click on one of the table columns then the content is
displayed. The content is also displayed if I remove the focus and
re-"setFocus".
If anyone has any ideas for displaying the content when the job completes
I would appreciate it.
TableViewer code :
tableViewer = new TableViewer(parent, SWT.SINGLE | SWT.FULL_SELECTION);
tableViewer.setContentProvider(new NewsContentProvider());
tableViewer.setLabelProvider(new NewsLabelProvider());
tableViewer.setSorter(new NewsViewerSorter());
....creating the TableColumns and attach the listeners for sorting...
//Generate the news -- (News extends Job)
news = new News(id);
news.setUser(true);
news.schedule();
news.addJobChangeListener(new JobChangeAdapter() {
public void done(IJobChangeEvent event) {
//Here I have tried everything but I cannot get the content to be
updated
tableViewer.refresh();
}
});
tableViewer.setInput(news);
table.setHeaderVisible(true);
table.setLinesVisible(true);
...
|
|
|
Re: TableViewer Refresh [message #467819 is a reply to message #467749] |
Tue, 07 February 2006 11:07 |
Eclipse User |
|
|
|
Originally posted by: avier5.gmail.com
I think you don't use the right way to control your GUI.
You have only one UI thread in the system...so instead of "Job" use the
Display.asyncExec/syncExec options.
|
|
|
Powered by
FUDForum. Page generated in 0.03706 seconds