Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Standard Widget Toolkit (SWT) » TableViewer Refresh
TableViewer Refresh [message #467749] Sun, 05 February 2006 23:02 Go to next message
Eclipse UserFriend
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 Go to previous message
Eclipse UserFriend
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.
Previous Topic:JFace Wizard question...
Next Topic:Refreshing
Goto Forum:
  


Current Time: Thu Apr 25 08:52:56 GMT 2024

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

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

Back to the top