Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Standard Widget Toolkit (SWT) » what is the best way to reload a widget to update it with new data
what is the best way to reload a widget to update it with new data [message #462196] Fri, 07 October 2005 18:54 Go to next message
Eclipse UserFriend
Originally posted by: tmcguire.go-integral.com

I have a table with a TableViewer and an IStructuredContentProvider.

The underlying data can change for a variety of reasons and I would like
to be able to trigger the table to reload. I don't know how to do this
and I assume there is a proscribed way of doing it.

Tim
Re: what is the best way to reload a widget to update it with new data [message #462198 is a reply to message #462196] Fri, 07 October 2005 21:00 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: richkulp.us.NO_SPAM.ibm.com

It depends. Is it the actual setInput(input) that needs to change or is
it the content that the "input" provides.

If it is the input that needs to be changed, you need a listener
somewhere which will put a new input into the TableViewer.

If it is the content that changes but not the input, then your content
provider on the inputChanged message needs to add listeners to the input
and then signal the TableViewer sent in to the input changed method that
it needs to refresh. You can call viewer.refresh() to refresh the entire
table, or viewer.refresh(element) to refresh just the changed element.

--
Thanks,
Rich Kulp
Re: what is the best way to reload a widget to update it with new data [message #462224 is a reply to message #462196] Sat, 08 October 2005 14:26 Go to previous message
Brad Reynolds is currently offline Brad ReynoldsFriend
Messages: 309
Registered: July 2009
Senior Member
Check out the javadoc for StructuredViewer. The refresh, update, and
setInput methods are probably what you should look at depending upon
what has changed. Also a lot of SWT people use viewers and can help but
viewers are a part of platform. So there's probably more information on
the platform newsgroup.

Tim McGuire wrote:
> I have a table with a TableViewer and an IStructuredContentProvider.
>
> The underlying data can change for a variety of reasons and I would like
> to be able to trigger the table to reload. I don't know how to do this
> and I assume there is a proscribed way of doing it.
>
> Tim
Previous Topic:Painting on a GC at a decent speed
Next Topic:Help!!!Who knows how to set the table's column editable in SWT !!!
Goto Forum:
  


Current Time: Fri Apr 26 06:37:19 GMT 2024

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

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

Back to the top