Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Eclipse Platform » No sorting called on TableViewer.update()
No sorting called on TableViewer.update() [message #265546] Thu, 05 August 2004 17:46 Go to next message
Eclipse UserFriend
Originally posted by: smallpocks.yahoo.com

Hello,
I have a problem with my TableViewer. I have given it a sorter that sorts by
the String name of my objects. It works fine when the plugin is first
started up. It sorts everything. However, when the model changes, I call
TableViewer.update(model_object,null) and the table does not get sorted. I
am sure that update is getting called. If I replace update with refresh then
everything works just fine. It's just that I'd rather be able to call update
for efficiency reasons. I am running Eclipse Release 3.0.
Thanks for any help.
Nels
Re: No sorting called on TableViewer.update() [message #265563 is a reply to message #265546] Thu, 05 August 2004 19:11 Go to previous messageGo to next message
Paul E. Keyser is currently offline Paul E. KeyserFriend
Messages: 878
Registered: July 2009
Senior Member
I'm pretty sure that update() is not supposed to call the sorter; in
fact, the update() suite of methods exists precisely to just update one
or a few items. In your case, you'd want to use refresh(), I think.

HTH,
Paul

Nels Beckman wrote:

> Hello,
> I have a problem with my TableViewer. I have given it a sorter that sorts by
> the String name of my objects. It works fine when the plugin is first
> started up. It sorts everything. However, when the model changes, I call
> TableViewer.update(model_object,null) and the table does not get sorted. I
> am sure that update is getting called. If I replace update with refresh then
> everything works just fine. It's just that I'd rather be able to call update
> for efficiency reasons. I am running Eclipse Release 3.0.
> Thanks for any help.
> Nels
>
>
Re: No sorting called on TableViewer.update() [message #265573 is a reply to message #265563] Thu, 05 August 2004 20:41 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: smallpocks.yahoo.com

Thanks for responding. Although you may be correct, and I am perfectly fine
with calling refresh, I was only doing what I had seen in the Eclipse
JavaDoc.

From org.eclipse.jface.viewers.StructuredViewer:
update
public void update(Object[] elements,
String[] properties)
"...
If the viewer has a sorter which is affected by a change to one of the
properties, the elements' positions are updated to maintain the sort order.
...."

If this is not correct, maybe the JavaDoc should be updated.
Nels


"Paul Keyser" <rolarenfan@earthlink.net> wrote in message
news:ceu0ls$qvj$3@eclipse.org...
> I'm pretty sure that update() is not supposed to call the sorter; in
> fact, the update() suite of methods exists precisely to just update one
> or a few items. In your case, you'd want to use refresh(), I think.
>
> HTH,
> Paul
>
> Nels Beckman wrote:
>
> > Hello,
> > I have a problem with my TableViewer. I have given it a sorter that
sorts by
> > the String name of my objects. It works fine when the plugin is first
> > started up. It sorts everything. However, when the model changes, I call
> > TableViewer.update(model_object,null) and the table does not get sorted.
I
> > am sure that update is getting called. If I replace update with refresh
then
> > everything works just fine. It's just that I'd rather be able to call
update
> > for efficiency reasons. I am running Eclipse Release 3.0.
> > Thanks for any help.
> > Nels
> >
> >
Re: No sorting called on TableViewer.update() [message #266025 is a reply to message #265573] Mon, 09 August 2004 08:16 Go to previous message
Markus KellerFriend
Messages: 294
Registered: July 2009
Senior Member
See https://bugs.eclipse.org/bugs/show_bug.cgi?id=50956
and if possible, attach steps to reproduce the problem.

Markus


Nels Beckman wrote:
> Thanks for responding. Although you may be correct, and I am perfectly fine
> with calling refresh, I was only doing what I had seen in the Eclipse
> JavaDoc.
>
> From org.eclipse.jface.viewers.StructuredViewer:
> update
> public void update(Object[] elements,
> String[] properties)
> "...
> If the viewer has a sorter which is affected by a change to one of the
> properties, the elements' positions are updated to maintain the sort order.
> ..."
>
> If this is not correct, maybe the JavaDoc should be updated.
> Nels
[..]
Previous Topic:Mission critical problem getting System properites
Next Topic:strange menu/toolbar behavior
Goto Forum:
  


Current Time: Tue Jul 16 10:18:42 GMT 2024

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

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

Back to the top