Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » JFace » Tableviewer with contents being added dynamically
Tableviewer with contents being added dynamically [message #498766] Wed, 18 November 2009 15:15 Go to next message
Fredrik Lindqvist is currently offline Fredrik LindqvistFriend
Messages: 13
Registered: November 2009
Junior Member
Hey

I have a TitleAreaDialog containing a TableViewer. Not too different from the basic snippet example:
http://dev.eclipse.org/viewcvs/index.cgi/org.eclipse.jface.s nippets/Eclipse%20JFace%20Snippets/org/eclipse/jface/snippet s/viewers/Snippet001TableViewer.java?view=markup

Now, the contents of the table are something that will take some time to calculate, so I want to do this in a background job in a separate thread and have the table show the contents as they are done.

What is the best way to handle the communication between the background job and the Table?
Re: Tableviewer with contents being added dynamically [message #498786 is a reply to message #498766] Wed, 18 November 2009 15:34 Go to previous messageGo to next message
Thomas Schindl is currently offline Thomas SchindlFriend
Messages: 6651
Registered: July 2009
Senior Member
Take a look at
http://wiki.eclipse.org/JFaceSnippets#Snippet047WizardWithLo ngRunningOperation
which does something similar with a wizard.

Tom

Fred schrieb:
> Hey
>
> I have a TitleAreaDialog containing a TableViewer. Not too different
> from the basic snippet example:
> http://dev.eclipse.org/viewcvs/index.cgi/org.eclipse.jface.s nippets/Eclipse%20JFace%20Snippets/org/eclipse/jface/snippet s/viewers/Snippet001TableViewer.java?view=markup
>
>
> Now, the contents of the table are something that will take some time to
> calculate, so I want to do this in a background job in a separate thread
> and have the table show the contents as they are done.
> What is the best way to handle the communication between the background
> job and the Table?
Re: Tableviewer with contents being added dynamically [message #499057 is a reply to message #498766] Thu, 19 November 2009 16:38 Go to previous message
Fredrik Lindqvist is currently offline Fredrik LindqvistFriend
Messages: 13
Registered: November 2009
Junior Member
Thanks!

I did not get that code example to work ("Exception in thread "main" java.lang.NoClassDefFoundError: org/eclipse/core/runtime/IStatus"), but it helped me forward. The key seems to be the asyncExec method call.

See http://help.eclipse.org/help32/index.jsp?topic=/org.eclipse. platform.doc.isv/reference/api/org/eclipse/swt/widgets/Displ ay.html
or
http://www.ryanlowe.ca/blog/archives/000448_the_swt_thread.p hp
Previous Topic:TreeViewer - Eclipse UI hangs when connection is gone, using DeferredTreeContentManager
Next Topic:SourceViewer + Custom Scanner + Annotations = exception
Goto Forum:
  


Current Time: Wed Apr 24 23:07:07 GMT 2024

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

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

Back to the top